ROS Melodic , for install instructions follow LINK.
Setup the ROS Environment
Navigate to carla build directory , you should find *.egg file in carla/Dist/CARLA_Shipping_0.9.8-***********/LinuxNoEditor/PythonAPI/carla/dist/ folder, which to be exported to python environment to run further simulations. Make sure you export appropiate egg file based on your preferred python version.
Install SLAM Nodes
- Install Gmapping by sudo apt-get install ros-melodic-slam-gmapping.
- Install Hector SLAM by sudo apt-get install ros-melodic-hector-slam.
- Install RTAB-Map by sudo apt-get install ros-kinetic-rtabmap-ros.
- Karto SLAM needs to be build from the source , follow standard ROS package installation procedure. The Kartoslam Github repo can be found LINK.
Clone the SLAM packages https://github.com/prithvisekhar/ROS-AD-SLAM-Evaluation.git
Copy the ros-bridge contents to a ros workspace src folder and build the workspace and source the workspace before running the roscore.
Running the Simulator
Run Carla simulator by navigating to carla/Dist/CARLA_Shipping_0.9.8-***********/LinuxNoEditor/ and running ./CarlaUE4.sh if you are using opengl then you should pass -opengl as configuration along with the carla launch command.
it should open the simulator (Refer the below image as reference). For More info on graphics support follow this LINK
Run the Carla ROS Client roslaunch carla_ros_bridge carla_ros_bridge_with_example_ego_vehicle.launch , Refer the below image as reference
Run the Gmapping Node roslaunch carlabg Gmapping_Carla.launch , for configuration option see ros-bridge/carlabg/launch folder. After mapping session is over save the map using map_saver tool rosrun map_server map_saver -f /path to your file.
Run the Hector SLAM Node roslaunch carlabg Hectormapping_Carla.launch. Follow the same map saver command to save the map for Hector SLAM.
Run the Karto SLAM Node roslaunch carlabg KartoSLAM2.launch. Follow the same map saver command but this time pass the map frame as map2.
Launch the RTAB-Map Node roslaunch carlabg RtabMapping_Carla.launch. RTAB Map can be directly saved from the RTAB map application.
It seems that the CarlaPCtoLS.launch file in pointcloud_to_laserscan is missing in this repo. Could you please kindly update it in this repo or just copy and paste it here. I'm figuring out how to publish 2D LaserScan in Carla.
Hello! I am trying to run gmapping with CARLA following the instructions given in README.md but the map doesn't exist in RViz. Specifically, I am running the following commands:
roslaunch carlabg Gmapping_Carla.launch
I am trying to see if the corresponding topics take messages correctly using the command "rostopic hz 'topic name' or rostopic echo 'topic name' " but I take the following result which means that these topics don't take any messages.
I know that gmapping needs as input "sensor_msgs/LaserScan" messages in order to work properly, but as I see at the available topics the output of the Lidar gives "sensor_msgs/PointCloud2" messages. Then I tried to convert them from pointcloud2 to laserscan by using this package http://wiki.ros.org/pointcloud_to_laserscan and running the following command:
rosrun pointcloud_to_laserscan pointcloud_to_laserscan_node cloud_in:= 'topic name of point cloud' but I couldn't take the map.
Generally, I couldn't make any algorithm to work properly and give me back a map, so your help will be precious. I can give you information about other ways that I tried to run SLAM with CARLA and ROS. Thanks!