Skip to content
Snippets Groups Projects
Commit 3bd716c1 authored by Marko Guberina's avatar Marko Guberina
Browse files

frame id has to be a string. can't run at 250Hz, shit brakes

parent 87daaf32
No related branches found
No related tags found
No related merge requests found
......@@ -167,5 +167,5 @@ if __name__ == "__main__":
wrench_message.wrench.torque.y = pb2_msg.wrench[4]
wrench_message.wrench.torque.z = pb2_msg.wrench[5]
wrench_message.header.stamp = rospy.Time.now()
wrench_message.header.frame_id = 0
wrench_message.header.frame_id = "0"
pub.publish(wrench_message)
......@@ -50,6 +50,7 @@ def parse_message(buffer):
# ros parts
#if False:
if importlib.util.find_spec("rospy"):
ros1_exists = True
rospy.init_node("ur5e_to_ros1_mapper", anonymous=True)
......@@ -73,8 +74,8 @@ buffer = b""
while True:
msg_raw = comm_socket.recv(1024)
buffer += msg_raw
print(msg_raw)
print(len(msg_raw))
# print(msg_raw)
# print(len(msg_raw))
if len(msg_raw) < 1:
continue
msg_in_bytes, pos = parse_message(buffer)
......@@ -97,5 +98,5 @@ while True:
wrench_message.wrench.torque.y = pb2_msg.wrench[4]
wrench_message.wrench.torque.z = pb2_msg.wrench[5]
wrench_message.header.stamp = rospy.Time.now()
wrench_message.header.frame_id = 0
wrench_message.header.frame_id = "0"
pub.publish(wrench_message)
......@@ -55,12 +55,13 @@ def sendRandomForTest(comm_socket):
pb2_msg.position.extend([random.random()] * 3)
pb2_msg.rotation.extend([random.random()] * 4)
pb2_msg.velocity.extend([random.random()] * 6)
# print(pb2_msg)
print(pb2_msg)
msg_length = pb2_msg.ByteSize()
msg_serialized = pb2_msg.SerializeToString()
msg = _VarintBytes(msg_length) + msg_serialized
comm_socket.send(msg)
time.sleep(0.002)
#time.sleep(0.002)
time.sleep(0.02)
if __name__ == "__main__":
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment