for a university project I started working with Turtlebot3, ROS2 (foxy), rclpy and gazebo. While studying them, I found a lot of basic examples for ROS1 (noetic), e.g. how to subscribe and read joint_states and the scan (LaserScan) topic. I tried to convert these examples to rclpy and it worked well for reading the joint_states but it failed for reading the scan topic. To me, it looks like Turtlebot3 hasn’t fully updated the packages and the dependencies for ROS2 or rclpy (yet).
I created two videos to show you the problem:
With ROS1 (noetic), rospy and Ubuntu 20.04 the readings are working:
With ROS2 (foxy), rclpy and Ubuntu 20.04 the readings for the joint_states are working but fail when I try to read the LaserScan. In rqt for example, I can read data for the joint_states but no data is shown for the LaserScan:
Now, my Question is:
Is there a solution to read the scan topic (LaserScan) with rclpy?