Ask Your Question

Revision history [back]

click to hide/show revision 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:

  1. The wheels are "white" instead of the given color or the default red
  2. The wheels originate at 0, 0, 0 instead of the place the joint in URDF says they should
  3. RVIZ lists this error for the transforms in the robot model:

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.

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:

  1. The wheels are "white" instead of the given color or the default red
  2. The wheels originate at 0, 0, 0 instead of the place the joint in URDF says they should
  3. RVIZ lists this error for the transforms in the robot model:

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.

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:

  1. The wheels are "white" instead of the given color or the default red
  2. The wheels originate at 0, 0, 0 instead of the place the joint in URDF says they should
  3. RVIZ lists this error for the transforms in the robot model:

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)

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)

ROS Happy Wheels.png

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)

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)

ROS Happy Wheels.png

The difference is this line:

js.header.stamp = rosNow

Without the time stamp the joint_states message was not working.