Complete the code to launch the gmapping node in ROS.
roslaunch gmapping slam_gmapping[1]The gmapping node is launched using a .launch file in ROS.
Complete the code to subscribe to the LiDAR scan topic in a ROS node.
ros::Subscriber sub = nh.subscribe("[1]", 1000, scanCallback);
The LiDAR scan data is usually published on the /scan topic in ROS.
Fix the syntax error in the cartographer Lua configuration for IMU data.
TRAJECTORY_BUILDER_2D.use_imu_data = [1];In Cartographer's Lua config, boolean values are lowercase true or false. Here, disabling IMU data requires false.
Fill both blanks to configure the ROS node to publish the map and set the correct frame.
node_handle.param<std::string>("[1]", map_frame, "[2]");
odom and map frames.The parameter name is map_frame and the default frame is map for publishing the map in ROS.
Fill all three blanks to create a ROS launch argument for selecting the SLAM method.
<arg name="slam_method" default="[1]" doc="Select SLAM method: gmapping or cartographer" /> <include file="$(find [2])/launch/[3].launch" />
The default SLAM method is cartographer, the package is cartographer_ros, and the launch file is cartographer.launch.
