Unit5: Section 5.4, ROS2 control plugin does not publish transform of the 2 laser_scan links

I couldn’t get section 5.4 to work.

In Rviz the lidar does not show at the top of the robot, with “no transform” error

Gazebo console look like this:
[gzserver-1] [INFO] [1698963398.703108684] [box_bot_joint_state]: Going to publish joint [chassis_to_left_wheel_joint]
[gzserver-1] [INFO] [1698963398.703817784] [box_bot_joint_state]: Going to publish joint [chassis_to_rightwheel_joint]
[gzserver-1] [INFO] [1698963398.703848648] [box_bot_joint_state]: Going to publish joint [chassis_to_front_yaw_joint]
[gzserver-1] [INFO] [1698963398.703868332] [box_bot_joint_state]: Going to publish joint [chassis_to_back_yaw_joint]
[gzserver-1] [INFO] [1698963398.703886588] [box_bot_joint_state]: Going to publish joint [front_yaw_to_front_roll_joint]
[gzserver-1] [INFO] [1698963398.703904284] [box_bot_joint_state]: Going to publish joint [back_yaw_to_back_roll_joint]
[gzserver-1] [INFO] [1698963398.703922876] [box_bot_joint_state]: Going to publish joint [front_roll_to_front_pitch_joint]
[gzserver-1] [INFO] [1698963398.703943612] [box_bot_joint_state]: Going to publish joint [back_roll_to_back_pitch_joint]
[gzserver-1] [INFO] [1698963398.893661659] [differential_drive_controller]: Wheel pair 1 separation set to [0.100000m]
[gzserver-1] [INFO] [1698963398.893735811] [differential_drive_controller]: Wheel pair 1 diameter set to [0.070000m]
[gzserver-1] [INFO] [1698963398.896178607] [differential_drive_controller]: Subscribed to [/cmd_vel]
[gzserver-1] [INFO] [1698963398.898962002] [differential_drive_controller]: Advertise odometry on [/odom]
[gzserver-1] [INFO] [1698963398.902352218] [differential_drive_controller]: Publishing odom transforms between [odom] and [base_link]
[gzserver-1] [INFO] [1698963399.004704465] [gazebo_ros2_control]: Loading gazebo_ros2_control plugin
[gzserver-1] [INFO] [1698963399.009901344] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in namespace: /
[gzserver-1] [INFO] [1698963399.009987881] [gazebo_ros2_control]: Starting gazebo_ros2_control plugin in ros 2 node: gazebo_ros2_control
[gzserver-1] [INFO] [1698963399.010052656] [gazebo_ros2_control]: Loading parameter file /home/user/ros2_ws/install/my_box_bot_description/share/my_box_bot_description/config/controller_position.yaml
[gzserver-1]
[gzserver-1] [INFO] [1698963399.013748978] [gazebo_ros2_control]: connected to service!! /my_robot_state_publisher_node
[gzserver-1] [ERROR] [1698963399.093357575] [rclcpp]: Received invalid sequence number. Ignoring…
[gzserver-1] [INFO] [1698963399.093570614] [gazebo_ros2_control]: Recieved urdf from param server, parsing…
[gzserver-1] [WARN] [1698963399.113470772] [gazebo_ros2_control]: Skipping joint in the URDF named ‘laser_scan_link_joint’ which is not in the gazebo model.
[gzserver-1] [INFO] [1698963399.114235936] [gazebo_ros2_control]: Loading controller_manager
[gzserver-1] [WARN] [1698963399.190865273] [gazebo_ros2_control]: Desired controller update period (0.01 s) is slowerthan the gazebo simulation period (0.001 s).
[gzserver-1] [INFO] [1698963399.191028861] [gazebo_ros2_control]: Loaded gazebo_ros2_control.
[gzserver-1] [INFO] [1698963399.400595647] [controller_manager]: Loading controller ‘joint_trajectory_controller’
[gzserver-1] [INFO] [1698963399.507046221] [controller_manager]: Loading controller ‘joint_state_broadcaster’
[gzserver-1] [INFO] [1698963399.585599002] [controller_manager]: Configuring controller ‘joint_trajectory_controller’
[gzserver-1] [INFO] [1698963399.585992253] [joint_trajectory_controller]: Command interfaces are [position] and and state interfaces are [position velocity].
[gzserver-1] [INFO] [1698963399.588905656] [joint_trajectory_controller]: Controller state will be published at 50.00 Hz.
[gzserver-1] [INFO] [1698963399.594977817] [joint_trajectory_controller]: Action status changes will be monitored at 20.00 Hz.
[gzserver-1] [INFO] [1698963399.601181580] [controller_manager]: Configuring controller ‘joint_state_broadcaster’
[gzserver-1] [INFO] [1698963399.601441149] [joint_state_broadcaster]: ‘joints’ or ‘interfaces’ parameter is empty. Allavailable state interfaces will be published
[gzserver-1] [ERROR] [1698963399.605329405] [controller_manager]: Can’t activate controller ‘joint_trajectory_controller’: Command interface with ‘laser_scan_link_joint/position’ does not exist
[gzserver-1] [ERROR] [1698963399.692079926] [joint_state_broadcaster]: None of requested interfaces exist. Controller will not run.
[gzserver-1] [ERROR] [1698963399.692242767] [controller_manager]: After activating, controller ‘joint_state_broadcaster’ is in state ‘finalized’, expected Active

It complains that joint “laser_scan_link_joint” does not exist.

But I have copy and pasted the following 5 files from the course notebook (I tried to type my own version as I learn, but struggled to get it to work):

  • control.launch.py
  • spawn_robot_ros2_control_complete.launch.py
  • controller_position_yaml
  • urdf_visualize_control_complete.launch.py
  • box_bot_control_complete.urdf

Is anyone else having similar problem?

Thanks!

Hi @chenlu.han ,

I think your robot is missing Laser Scanner links and joints in the URDF file.
Add those parts and your problem should be resolved.

Let me know if you still have issues after doing this.

Regards,
Girish

Hi Girish,

Thanks for your reply.

It is interesting that today I launched the nodes, and the laser scanner does appear at the right place. I did not make any change to my code…

So I guess the problem in the original post is solved.
But in general, how do I avoid this inconsistent behavior in the future? Has anyone experienced that before? Is it unique to the ConstructSim VM?

Thanks

Hi @chenlu.han ,

It could be due to the VM being not fully initialized. Or it could also be due to Gazebo being not fully initialized.

If you encounter the same problem again, try to terminate Gazebo from the terminal you launched it by pressing Ctrl + C. Then relaunch Gazebo after 5 to 10 seconds. If this step does not fix the issue, then close the course and clear your browser cookies (not the entire history), and then launch the course page after 15 minutes exactly, so that the VM resets itself.

Regards,
Girish

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.