IT/Robot

[ROS2] CLOi ROS2 Simulator

루벤초이 2022. 3. 6. 23:17

It seems that the simulator does not work on Ubuntu 22.04 yet.

Ubuntu 20.04 ROS2 Foxy

CLOi Simulator 

Download the release from https://github.com/lge-ros2/cloisim/releases

Extract CLOiSim-linux-3.0.4.tar.gz and sample_resources-main.tar.gz

Open CLOiSim-linux-3.0.4/run.sh and add export CLOISIM_XXXXXX to sample_resources directory.

 

Run the simulator

$./run.sh lg_seocho.world

 

CLOiSim_ROS

Extract cloi_common_interfaces-2.0.0 and cloisim_ros-2.13.0 and move them to cloisim_ws/src. Then, build them.

$source cloisim_ws/install/setup.bash 
$colcon build --symlink-install

Run
$ros2 launch cloisim_ros_bringup bringup.launch.py

Tele-operation

$source /opt/ros/foxy/setup.bash
$ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args --remap __ns:=/cloi1

 

SLAM

According to Turtlebot3 website, SLAM (Simultaneous Localization and Mapping) is to draw a map by estimating current location in an arbitrary space and it is done by using catographer in turtlebot3.

ros2 launch turtlebot3_cartographer cartographer.launch.py use_sim_time:=True

However, CLOi simulator does not have something like cloi_cartographer, so I contact the clever and kind CLOi developer and got the solution using slam_toolbox as follows (thanks to zikprid0@github):

  1. run CLOiSim
  2. run cloisim_ros in single_mode (the reason is that slam_toolbox does not recognize namespace other than single_mode) Do not use single_mode:=True for navigation2.
    • ros2 launch cloisim_ros_bringup bringup.launch.py single_mode:=True
  3. run slam_toolbox
    • ros2 launch slam_toolbox online_async_launch.py
  4. run rviz2
    • add Map, LaserScan (Best Effort, 0.03m), TF topics
  5. run teleop_twist_keyboard and move the robots to draw the map
  6. save map
    • ros2 run nav2_map_server map_saver_cli -f my_map 
    • then .pgm and .yaml files generated
    • update .yaml file for navigation (such as origin)

 

Navigation 2

Download foxy-devel-cloi branch from https://github.com/lge-ros2/navigation2/tree/foxy-devel-cloi

$source /opt/ros/foxy/setup.bash
$colcon build --symlink-install

$source ./install/setup.bash 
$ros2 launch nav2_bringup full_launch.py use_sim_time:=True map:=<MAP_FILEPATH>.yaml use_namespace:=True namespace:=cloi1 autostart:=True

Please note that the map is not provided unfortunately. You need to create it by yourself. See the above Map section.

Check if both Navigation and Localization are active. Then, set the initial position using 2D Pose Estimate button.

Then move the robot using Navigation2 Goal button.

 

ROSboard

You can see the sensor information using ROSboard, a simple and great ROS2 web tool. Just run and open the browser with port 8888.

 

 

 

728x90
반응형