Skip to content

Latest commit

 

History

History
123 lines (78 loc) · 3.15 KB

README.md

File metadata and controls

123 lines (78 loc) · 3.15 KB

cloisim_ros (foxy version)

ROS2 simulation device packages to connect CLOiSim(the unity3D based multi-robot simulator).

Prerequisite

  • Download CLOiSim Simulator
    • CLOiSim: Latest link, All Releases link
rosdep update
rosdep install -y -r -q --from-paths src --ignore-src --rosdistro foxy

Build

Set up ROS2 environment first

source /opt/ros2/foxy/setup.bash
colcon build --symlink-install --packages-up-to cloisim_ros_bringup

Usage

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

Run all cloisim_ros (robot + factory)

strongly recommend to use this method.

Turn off single mode(=multi robot mode)

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

Turn on single Mode

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

Running CLOiSim

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

Using Docker

Run below command after clone this repository(this branch). Only support 'ros2 run'

Build Docker image

git clone https://github.com/lge-ros2/cloisim_ros.git -b foxy
cd cloisim_ros
docker build -t cloisim_ros .

Running container

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

Version info

  • Please refer to each branch for ROS2 distro-version you want