ROS2 simulation device packages to connect CLOiSim(the unity3D based multi-robot simulator).
rosdep update
rosdep install -y -r -q --from-paths src --ignore-src --rosdistro foxy
Set up ROS2 environment first
source /opt/ros2/foxy/setup.bash
colcon build --symlink-install --packages-up-to cloisim_ros_bringup
Set environment variable, if the server is not localhost
export CLOISIM_BRIDGE_IP='xxx.xxx.xxx.xxx'
export CLOISIM_SERVICE_PORT=8080
check here details
strongly recommend to use this method.
apply namespace for each robot)
ros2 run cloisim_ros_bringup cloisim_ros_bringup --ros-args -p singlemode:=False
ros2 run cloisim_ros_bringup cloisim_ros_bringup
or
ros2 launch cloisim_ros_bringup bringup.launch.py
ros2 launch cloisim_ros_bringup bringup.launch.py singlemode:=False
will NOT apply namespace for robot and the number of robot must BE single in world environment.
ros2 run cloisim_ros_bringup cloisim_ros_bringup --ros-args -p singlemode:=True
or
ros2 launch cloisim_ros_bringup bringup.launch.py singlemode:=True
it provides a script to run CLOiSim easily.
ros2 launch cloisim_ros_bringup cloisim.launch.py sim_path:=/opt/CLOiSim/CLOiSim-1.10.0 world:=lg_seocho.world
Run below command after clone this repository(this branch). Only support 'ros2 run'
git clone https://github.com/lge-ros2/cloisim_ros.git -b foxy
cd cloisim_ros
docker build -t cloisim_ros .
docker run -it --rm --net=host -e ROS_DOMAIN_ID=$ROS_DOMAIN_ID cloisim_ros
docker run -it --rm --net=host -e ROS_DOMAIN_ID=$ROS_DOMAIN_ID cloisim_ros singlemode:=False
docker run -it --rm --net=host -e ROS_DOMAIN_ID=$ROS_DOMAIN_ID cloisim_ros singlemode:=True
with default network driver(bridge)
docker run -it --rm -e CLOISIM_BRIDGE_IP='192.168.0.125' -e ROS_DOMAIN_ID=$ROS_DOMAIN_ID cloisim_ros
docker run -it --rm -e CLOISIM_BRIDGE_IP='192.168.0.125' -e ROS_DOMAIN_ID=$ROS_DOMAIN_ID cloisim_ros singlemode:=False
docker run -it --rm -e CLOISIM_BRIDGE_IP='192.168.0.125' -e ROS_DOMAIN_ID=$ROS_DOMAIN_ID cloisim_ros singlemode:=True
You can set bridge ip using below command.
echo $(ip addr show dev docker0 | grep "inet" | awk 'NR==1{print $2}' | cut -d'/' -f 1)
docker run -it --rm -e CLOISIM_BRIDGE_IP=`echo $(ip addr show dev docker0 | grep "inet" | awk 'NR==1{print $2}' | cut -d'/' -f 1)` -e ROS_DOMAIN_ID=$ROS_DOMAIN_ID cloisim_ros