
You should also see that the length of the ranges array is 720 in the 180-degree range. Now you can type roslaunch laser_values laser.launch Then we create a launch file under lunch directory to launch the script Normally, you’ll need to give the script permission to execute with $ chmod +x src/scan.py Sub = rospy.Subscriber('/kobuki/laser/scan', LaserScan, callback) $ cd ~/catkin_ws/srcĪdd a python script under src with the following code #! /usr/bin/env python To explore the range value, let’s create a package. The angle_min and angle_max indicate the angle range(from -90 to 90 degree in this case) that the LaserScan is measuring and the ranges is an array which gives you the distance measured for each angle bin. The command gives you the message’s structure. You can further check it with the command rosmsg show sensor_msgs/LaserScan You’ll see that the topic is using the message type called sensor_msgs/LaserScan. The following command will give you the information for the topic rostopic info /kobuki/laser/scan The -n1 flag prints the topic exactly once. You can type the following command into the terminal to check the topic.

The LaserScan topic is called /kobuki/laser/scan.

You can check all the topic available with the command: $ rostopic list Now, run the project on ROSDS and launch the Turtlebot2 by clicking the Simulation button. You can create a free account here.Īfter registration, login and add a new ROSject. We will reproduce the question by using ROSDS. Open a project on ROS Development Studio(ROSDS)
Webots tutorial how to#
In this video, we are going to see this question on ROS Answers – How to know the exact frame rate and angle of /scan on Turtlebot?
