ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ros2 rviz2 getting NaNs in TF for revolute joints, static world to base ok

asked 2019-12-09 12:52:16 -0500

guru_florida gravatar image

(using Eloquent on Ubuntu 18.04)

When starting RViz2 I am getting a lot of these errorsL

Error:   TF_DENORMALIZED_QUATERNION: Ignoring transform for child_frame_id "LShoulder" from authority "Authority undetectable" because of an invalid quaternion in the transform (-nan -nan -nan -nan)
   at line 282 in /tmp/binarydeb/ros-eloquent-tf2-0.12.4/src/buffer_core.cpp

and

Warning: Invalid frame ID "LShoulder" passed to canTransform argument source_frame - frame does not exist
         at line 133 in /tmp/binarydeb/ros-eloquent-tf2-0.12.4/src/buffer_core.cpp

You're probably thinking the usual problem: "He hasnt setup proper map or world static transform to base...." or something like that. :) Here is what I have so far in brief:

  • Ran the dummy_robot_bringup and reviewed all the code and urdf of this project including dummy_map_server and dummy_sensors with dummy_joint_publisher and laser. Code is simple enough.
  • Based on dummy urdf, In my URDF I added a world link and a fixed joint to my robot base (Torso). For now, this robot wont move in world so I dont have any intermediate frames...just Torso plus arm and leg appendages as revolutes.
  • created a joint_state_publisher based on the dummy_joint_publisher and it sends 0.0 as joint positions for all my named joints.
  • I publish the world to torso static joint using "ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 1 world Torso"
  • I also create a map node based off on dummy_map_server, but I am not exactly sure what this does....I think it does the same as the world=>Torso static joint above and I dont seem to need that command anymore.

Seems to me like I have the bases covered to get the TF to properly do the joint kinematics but what I get is a big tangled blob of my links. RViz2 console output is complaining about NaNs inputs and invalid frames (named after my robot appendages/links). RVIz2 RobotModel shows URDF parsed and world anad Torso TF is good, but other appendages "No transform from [...] to [world]". Not sure why its appendage to [world] since the appendages are linked to each other and only connected to world via Torso. The RViz2 TF tree only shows world and Torso for frames....I expect it should show all appendages as frames too.

Diagnostics: Using "ros2 topic echo /tf" I can see all the messages are NaN, it does list each of the appendage joints but only pasting one here.

- header:
    stamp:
      sec: 1575916363
      nanosec: 321309490
    frame_id: /Torso
  child_frame_id: /LShoulder
  transform:
    translation:
      x: .nan
      y: .nan
      z: .nan
    rotation:
      x: .nan
      y: .nan
      z: .nan
      w: .nan

Echoing /joint_states I am getting valid joint data for each of my joints J21 - J29 and the case correctly match my URDF joint names. Is the frame_id in the header here supposed to be blank?

---
header:
  stamp:
    sec: 1575916473
    nanosec: 621314545
  frame_id: ''
name:
- J21
- J22
- J23
- J24
- J25
- J26
- J27
- J28
- J29
position:
- -0.8096112710568957
- -0.8096112710568957
- -0.8096112710568957
- -0.8096112710568957
- -0.8096112710568957
- -0.8096112710568957
- -0.8096112710568957
- -0.8096112710568957
- -0.8096112710568957
velocity ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-12-09 15:40:09 -0500

guru_florida gravatar image

Solved. LOL!! Maybe it would help if I set one of the zero's in <axis xyz="0 0 0"/> to 1 so the TF would know what axis to apply the joint angle too. Now my robot is appearing normally and no errors.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2019-12-09 12:52:16 -0500

Seen: 837 times

Last updated: Dec 09 '19