To modify the range scan of the TurtleBot3 in the real version, you need to modify the parameters of the LIDAR sensor. Specifically, you need to change the number of samples and the range of the scan.
To do this, you can use the dynamic reconfigure package in ROS. This package allows you to change the parameters of a node at runtime using a GUI or command-line tool.
First, you need to install the dynamic reconfigure package by running the following command:
sudo apt-get install ros-kinetic-dynamic-reconfigure
Next, launch the TurtleBot3 with the LIDAR sensor:
roslaunch turtlebot3_bringup turtlebot3_robot.launch
Then, run the dynamic reconfigure GUI:
rosrun rqt_reconfigure rqt_reconfigure
In the GUI, select the /scan topic and then the LaserScan module. You should see several parameters, including angle_min, angle_max, angle_increment, time_increment, scan_time, and range_min and range_max.
Change the angle_min and angle_max parameters to the desired range of the scan. For example, if you want a 24-sample scan with a range of 30 degrees, set angle_min to -15 and angle_max to 15.
Finally, click the Apply button to apply the changes.
Alternatively, you can use the dynamic_reconfigure command-line tool to set the parameters. For example, to set the angle_min parameter to -15, you can run:
rosrun dynamic_reconfigure dynparam set /scan angle_min -15.0
Note that these changes will not persist after you shutdown the node. If you want to make the changes permanent, you can modify the launch file for the TurtleBot3 or write a ROS parameter file.