ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
The problem was a lack of a timestamp in the header on the JointState. I introduced this error when I was modifying the code.
Here is a full explanation in case it helps someone else:
This is the broken code that causes these symptoms in RVIZ:
No transform from [left_wheel_link] to [base_footprint]
and
No transform from [right_wheel_link to [base_footprint]
Please note that publishing this static transform from a python script may be a bad idea, especially if you are in a tight loop publishing rapidly. I think a better solution may be to just make the wheel joint fixed in the URDF if it is not accomplishing anything for you. Another option would be to put a static transform for this joint into a launch file. But I wanted to explain what the cause of this error was.
BAD CODE:
js = JointState(name = ["left_wheel_joint", "right_wheel_joint", "front_castor_joint", "back_castor_joint"],
position=[0,0,0,0], velocity=[0,0,0,0], effort=[0,0,0,0])
self.joint_states_pub.publish(js)
C:\fakepath\ROS Bad Wheels.png
And here is the code that works fine:
js = JointState(name = ["left_wheel_joint", "right_wheel_joint", "front_castor_joint", "back_castor_joint"],
position=[0,0,0,0], velocity=[0,0,0,0], effort=[0,0,0,0])
js.header.stamp = rosNow
self.joint_states_pub.publish(js)
C:\fakepath\ROS Happy Wheels.png
The difference is this line:
js.header.stamp = rosNow
Without the time stamp the joint_states message was not working.
2 | No.2 Revision |
The problem was a lack of a timestamp in the header on the JointState. I introduced this error when I was modifying the code.
Here is a full explanation in case it helps someone else:
This is the broken code that causes these symptoms in RVIZ:
No transform from [left_wheel_link] to [base_footprint]
and
No transform from [right_wheel_link to [base_footprint]
Please note that publishing this static transform from a python script may be a bad idea, especially if you are in a tight loop publishing rapidly. I think a better solution may be to just make the wheel joint fixed in the URDF if it is not accomplishing anything for you. Another option would be to put a static transform for this joint into a launch file. But I wanted to explain what the cause of this error was.
BAD CODE:
js = JointState(name = ["left_wheel_joint", "right_wheel_joint", "front_castor_joint", "back_castor_joint"],
position=[0,0,0,0], velocity=[0,0,0,0], effort=[0,0,0,0])
self.joint_states_pub.publish(js)
C:\fakepath\ROS ROS Bad Wheels.png
And here is the code that works fine:
js = JointState(name = ["left_wheel_joint", "right_wheel_joint", "front_castor_joint", "back_castor_joint"],
position=[0,0,0,0], velocity=[0,0,0,0], effort=[0,0,0,0])
js.header.stamp = rosNow
self.joint_states_pub.publish(js)
C:\fakepath\ROS ROS Happy Wheels.png
The difference is this line:
js.header.stamp = rosNow
Without the time stamp the joint_states message was not working.
3 | No.3 Revision |
The problem was a lack of a timestamp in the header on the JointState. I introduced this error when I was modifying the code.
Here is a full explanation in case it helps someone else:
This is the broken code that causes these symptoms in RVIZ:
No transform from [left_wheel_link] to [base_footprint]
and
No transform from [right_wheel_link to [base_footprint]
BAD CODE:
js = JointState(name = ["left_wheel_joint", "right_wheel_joint", "front_castor_joint", "back_castor_joint"],
position=[0,0,0,0], velocity=[0,0,0,0], effort=[0,0,0,0])
self.joint_states_pub.publish(js)
And here is the code that works fine:
js = JointState(name = ["left_wheel_joint", "right_wheel_joint", "front_castor_joint", "back_castor_joint"],
position=[0,0,0,0], velocity=[0,0,0,0], effort=[0,0,0,0])
js.header.stamp = rosNow
self.joint_states_pub.publish(js)
The difference is this line:
js.header.stamp = rosNow
Without the timestamp the joint_states message was not working.
Please note that publishing this static transform from a python script may be a bad idea, especially if you are in a tight loop publishing rapidly. I think a better solution may be to just make the wheel joint fixed in the URDF if it is not accomplishing anything for you. Another option would be to put a static transform for this joint into a launch file. But I wanted to explain what the cause of this error was.
BAD CODE:
js = JointState(name = ["left_wheel_joint", "right_wheel_joint", "front_castor_joint", "back_castor_joint"],
position=[0,0,0,0], velocity=[0,0,0,0], effort=[0,0,0,0])
self.joint_states_pub.publish(js)
And here is the code that works fine:
js = JointState(name = ["left_wheel_joint", "right_wheel_joint", "front_castor_joint", "back_castor_joint"],
position=[0,0,0,0], velocity=[0,0,0,0], effort=[0,0,0,0])
js.header.stamp = rosNow
self.joint_states_pub.publish(js)
The difference is this line:
js.header.stamp = rosNow
Without the time stamp the joint_states message was not working.