Joint state published by ROS bridge extension is incorrect

I am using the ROS bridge extension for publishing robot joint state, however it is publishing joint information that is obviously incorrect. Using even the sample from Isaac Robotics > ROS > Rostopics, I click the “Load Robot” button and press “Play”, the robot is in this joint configuration:

But the joint state message on doing a rostopic echo /joint_state is the following:

header: 
  seq: 3367
  stamp: 
    secs: 51
    nsecs: 977659037
  frame_id: ''
name: [panda_joint1, panda_joint2, panda_joint3, panda_joint4, panda_joint5, panda_joint6,
  panda_joint7, panda_finger_joint1, panda_finger_joint2]
position: [1.46575648614089e-05, 1.46575648614089e-05, 1.46575648614089e-05, 1.46575648614089e-05, 1.46575648614089e-05, 1.46575648614089e-05, 1.46575648614089e-05, 1.4657564533786795e-07, 1.4657564533786795e-07]
velocity: [-0.00038748938823118806, -0.00038748938823118806, -0.00038748938823118806, -0.00038748938823118806, -0.00038748938823118806, -0.00038748938823118806, -0.00038748938823118806, -0.00038748938823118806, -0.00038748938823118806]
effort: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

Notice all the arm joint positions are identical, and then the two finger positions are identical, all essentially zero even though arm is clearly not in zero position. I’ve also collected data from the robot actually moving around and same behavior, the values change but they all change in the same way (i.e. they are always just a vector of the same value, even though that value changes over time). I suspect it’s just taking the value of one of the joints and broadcasting the same value to all joints. Any idea how I can fix this? I can’t find source code for the ROS bridge and I’m trying to figure out how to access the joint data from the Python API but am having trouble. I appreciate any help.

As an update, I’ve been trying to use the omni.isaac.dynamic_control module to get at the joint positions there. I’m finding a similar problem. In this code snippet self.franka is a utils.franka.Franka object from the omni.isaac.samples path:

print("\nFRANKA")
count = self.franka.dc.get_articulation_dof_count(self.franka.ar)
dc = self.franka.dc
ar = self.franka.ar
for i in range(1, 8):
    dof_ptr = dc.find_articulation_dof(ar, "panda_joint{}".format(i))
    print("DOF", dof_ptr, dc.get_dof_position(dof_ptr))

Then while the robot is moving I get output like this (for a few timesteps):

FRANKA
DOF 2211908157441 -0.13668574392795563
DOF 2211908157442 -0.13668574392795563
DOF 2211908157443 -0.13668574392795563
DOF 2211908157444 -0.13668574392795563
DOF 2211908157445 -0.13668574392795563
DOF 2211908157446 -0.13668574392795563
DOF 2211908157447 -0.13668574392795563

FRANKA
DOF 2211908157441 -0.12159191817045212
DOF 2211908157442 -0.12159191817045212
DOF 2211908157443 -0.12159191817045212
DOF 2211908157444 -0.12159191817045212
DOF 2211908157445 -0.12159191817045212
DOF 2211908157446 -0.12159191817045212
DOF 2211908157447 -0.12159191817045212

FRANKA
DOF 2211908157441 -0.11500705778598785
DOF 2211908157442 -0.11500705778598785
DOF 2211908157443 -0.11500705778598785
DOF 2211908157444 -0.11500705778598785
DOF 2211908157445 -0.11500705778598785
DOF 2211908157446 -0.11500705778598785
DOF 2211908157447 -0.11500705778598785

You can see the dof pointers are distinct, yet at each timestep they give all the same value, and they all differ in the same way from timestep to timestep.

Welcome to the Forums and thanks for the feedback!

I’ll create a bug report for this issue.

Great thanks. Do you have any suggestions on a work-around so that I can get the correct joint state through the Python API somehow? I’m thinking now of trying to go directly through PhysicsSchema (e.g. RevolutePhysicsJoint) to get it, but am still not sure how to do it.

Are you able to run the Joint Monkey example in “Isaac Robotics->dynamics Control”?

Thanks for pointing me to that, I didn’t know about that example. Yes that runs fine for me, I see the DOF states changing correctly. It’s very strange, I don’t yet see what I’m doing differently. I’ll try to mimic that more closely in my setup and see what happens.

Did you press “play” before you clicked on “Connect Joint State Topics”?
It looks like there may be bug where if the rostopic for joint state is created while the editor is not playing, it’ll return the wrong values.

You’re right! Yeah I was connecting immediately after loading robot, and then pressing play. As long as I press play before loading joint state topics it works. Should this also be true for working with the _dynamic_control interface? The joint monkey example has a _on_first_step() to create the articulation handle after the editor is already playing, I guess that’s what it’s accounting for?

Excellent! Yes, the articulation doesn’t work unless physics is running (which is what “playing” the editor does), so that might be causing the handle to be invalid. Thanks for letting us know, we’ll fix it.

Thanks for your help, this was driving me nuts.