Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

joint_state_publisher_gui gives errors on using revolute joints with inf limits in SDF #105

Open
Amronos opened this issue Dec 1, 2024 · 2 comments · May be fixed by #106
Open

joint_state_publisher_gui gives errors on using revolute joints with inf limits in SDF #105

Amronos opened this issue Dec 1, 2024 · 2 comments · May be fixed by #106

Comments

@Amronos
Copy link

Amronos commented Dec 1, 2024

I have defined my revolute joint in SDF like this:

    <joint name="test_joint" type="revolute">
      <parent>base_link</parent>
      <child>test_link</child>
      <pose relative_to="base_link">1 1 1 0 0 0</pose>
      <axis>
        <xyz>0 0 1</xyz>
        <limit>
          <lower>-inf</lower>
          <upper>inf</upper>
        </limit>
      </axis>
    </joint>

I get the following errors:

[joint_state_publisher_gui-1] [INFO] [1733051122.369655512] [joint_state_publisher_gui]: Waiting for robot_description to be published on the robot_description topic...
[joint_state_publisher_gui-1] [INFO] [1733051122.387361215] [joint_state_publisher_gui]: Centering
[joint_state_publisher_gui-1] [INFO] [1733051122.495230202] [joint_state_publisher_gui]: Centering
[joint_state_publisher_gui-1] Traceback (most recent call last):
[joint_state_publisher_gui-1]   File "/opt/ros/jazzy/lib/python3.12/site-packages/joint_state_publisher_gui/joint_state_publisher_gui.py", line 207, in initializeSliders
[joint_state_publisher_gui-1]     self.centerEvent(None)
[joint_state_publisher_gui-1]   File "/opt/ros/jazzy/lib/python3.12/site-packages/joint_state_publisher_gui/joint_state_publisher_gui.py", line 245, in centerEvent
[joint_state_publisher_gui-1]     joint_info['slider'].setValue(self.valueToSlider(joint['zero'], joint))
[joint_state_publisher_gui-1]                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[joint_state_publisher_gui-1]   File "/opt/ros/jazzy/lib/python3.12/site-packages/joint_state_publisher_gui/joint_state_publisher_gui.py", line 255, in valueToSlider
[joint_state_publisher_gui-1]     return int((value - joint['min']) * float(RANGE) / (joint['max'] - joint['min']))
[joint_state_publisher_gui-1]            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[joint_state_publisher_gui-1] ValueError: cannot convert float NaN to integer

Then I get the below errors upon moving the sliders.

[rviz2-3] [ERROR] [1733051135.281374250] []: TF_NAN_INPUT: Ignoring transform for child_frame_id "test_link" from authority "Authority undetectable" because of a nan value in the transform (-nan -nan -nan) (-nan -nan -nan -nan)
[rviz2-3] [ERROR] [1733051135.281509904] []: TF_DENORMALIZED_QUATERNION: Ignoring transform for child_frame_id "test_link" from authority "Authority undetectable" because of an invalid quaternion in the transform (-nan -nan -nan -nan)

I think the infinite values for the limit cause this. I can not use a continuous joint in my case as Gazebo does not support it.

@Amronos Amronos changed the title joint_state_publisher_gui crashes on using revolute joints joint_state_publisher_gui crashes on using revolute joints with inf limits in SDF Dec 9, 2024
@Amronos Amronos changed the title joint_state_publisher_gui crashes on using revolute joints with inf limits in SDF joint_state_publisher_gui gives errors on using revolute joints with inf limits in SDF Dec 9, 2024
@DLu
Copy link
Contributor

DLu commented Dec 10, 2024

To me, this is a Gazebo bug, and the correct answer is to use a continuous joint. What happens in Gazebo?

@Amronos
Copy link
Author

Amronos commented Dec 11, 2024

To me, this is a Gazebo bug, and the correct answer is to use a continuous joint. What happens in Gazebo?

gazebosim/sdformat#326 does provide some details on this.
I don't really see a problem in supporting a revolute joint with infinite limits in joint_state_publisher/joint_state_publisher_gui till continuous joints are supported by Gazebo.
After continuous joints are supported by Gazebo, a warning or error could be added instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants