Giter Site home page Giter Site logo

lge-ros2 / cloisim_ros Goto Github PK

View Code? Open in Web Editor NEW
11.0 3.0 5.0 1.02 MB

ROS2 simulation device packages to connect unity based multi-robot simulator CLOisim.

License: MIT License

Shell 0.12% Dockerfile 0.23% CMake 17.62% Python 2.22% C++ 77.82% C 1.99%
ros2 sensor device robot robotics robotics-simulation bridge cloisim multi-robot-simulator simulation foxy ros cloisim-ros docker

cloisim_ros's Introduction

cloisim_ros (humble version)

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

Download CLOiSim Simulator

  • Latest version: link
  • All Releases: link

Install ROS2 humble

follow the guideline on below link.

https://docs.ros.org/en/humble/Installation/Ubuntu-Install-Debians.html

Prerequisite

sudo apt update
sudo apt install -y python3-rosdep
sudo rosdep init
rosdep update
rosdep install -y -r -q --from-paths src --ignore-src --rosdistro humble

Build

Set up ROS2 environment first

source /opt/ros2/humble/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 for bring-up guide

Run cloisim_ros (robot + world)

Shared Memory DDS with FastRTPS

It's experimental feature for cloisim_ros. Use absolute path in FASTRTPS_DEFAULT_PROFILES_FILE environment variable.

For example,

export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
export FASTRTPS_DEFAULT_PROFILES_FILE=/home/cloi/src/cloisim_ros/fastrtps_shared_profile.xml

Turn off single mode(=multi robot mode)

Apply namespaceas each robot as a multi robot mode.

Strongly recommend to use this method.

ros2 launch cloisim_ros_bringup bringup.launch.py

or

ros2 launch cloisim_ros_bringup bringup.launch.py single_mode:=False

Turn on single Mode

It shall NOT be applied namespace for robot and the number of robot must BE single in world environment.

ros2 launch cloisim_ros_bringup bringup.launch.py single_mode:=True

Running CLOiSim

It provides a script to run CLOiSim easily.

ros2 launch cloisim_ros_bringup cloisim.launch.py sim_path:=/opt/CLOiSim/CLOiSim-2.2.0 world:=lg_seocho.world

Using Docker

Run below command after clone this repository(this branch).

Build Docker image

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

Running container

You can add possible parameters as described above. ex) target_model, target_parts_type or target_parts_name

multi robot mode

docker run -it --rm --net=host -e ROS_DOMAIN_ID=$ROS_DOMAIN_ID cloisim_ros

single robot mode

docker run -it --rm --net=host -e ROS_DOMAIN_ID=$ROS_DOMAIN_ID cloisim_ros single_mode:=True

multi robot mode 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

single robot mode 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 single_mode:=True

You can set bridge ip using below command.

export CLOISIM_BRIDGE_IP=$(ip addr show dev docker0 | grep "inet" | awk 'NR==1{print $2}' | cut -d'/' -f 1)
echo $CLOISIM_BRIDGE_IP
docker run -it --rm -e CLOISIM_BRIDGE_IP=$CLOISIM_BRIDGE_IP -e ROS_DOMAIN_ID=$ROS_DOMAIN_ID cloisim_ros

Version info

cloisim_ros's People

Contributors

hyunseok-yang avatar yjkim046 avatar zikprid0 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

cloisim_ros's Issues

cloisim 가상 머신 연동

가상머신을 활용하여 우분투 20.04 LTS에서 시도하고 있습니다

아래와 같이 명령어를 입력했을때 오류가 나는데요
CMakeList에 find_package(websocketpp REQUIRED)를 못찾는것 같습니다.
cloisim_ros 내부에 해당 패키지가 있나요?

"colcon build --symlink-install --packages-up-to cloisim_ros_bringup"

Starting >>> cloisim_ros_bridge_zmq
Starting >>> cloisim_ros_protobuf_msgs
Starting >>> cloisim_ros_websocket_service
--- stderr: cloisim_ros_websocket_service
CMake Error at CMakeLists.txt:23 (find_package):
By not providing "Findwebsocketpp.cmake" in CMAKE_MODULE_PATH this project
has asked CMake to find a package configuration file provided by
"websocketpp", but CMake did not find one.

Could not find a package configuration file provided by "websocketpp" with
any of the following names:

websocketppConfig.cmake
websocketpp-config.cmake

Add the installation prefix of "websocketpp" to CMAKE_PREFIX_PATH or set
"websocketpp_DIR" to a directory containing one of the above files. If
"websocketpp" provides a separate development package or SDK, be sure it
has been installed.


Failed <<< cloisim_ros_websocket_service [0.67s, exited with code 1]
Aborted <<< cloisim_ros_bridge_zmq [0.74s]
Aborted <<< cloisim_ros_protobuf_msgs [0.95s]

Summary: 0 packages finished [1.09s]
1 package failed: cloisim_ros_websocket_service
2 packages aborted: cloisim_ros_bridge_zmq cloisim_ros_protobuf_msgs
2 packages had stderr output: cloisim_ros_protobuf_msgs cloisim_ros_websocket_service
12 packages not processed

Error occur when making docker image

I'm trying to build docker image cloisim_ros. however, when I ran docker built, compile error occur at 'imageStarting >>> cloisim_ros_bringup'. Detail error is like below.

Step 8/10 : RUN ["/bin/bash", "-c", "source /opt/ros/${ROS_DISTRO}/setup.bash; colcon build --symlink-install"]
---> Running in 1c6148594024
Starting >>> cloisim_ros_bridge_zmq
Starting >>> cloisim_ros_protobuf_msgs
Starting >>> elevator_system_msgs
Starting >>> realsense_adaptor_msgs
Finished <<< cloisim_ros_bridge_zmq [4.13s]
Finished <<< cloisim_ros_protobuf_msgs [10.4s]
Starting >>> cloisim_ros_base
Finished <<< realsense_adaptor_msgs [14.1s]
Finished <<< elevator_system_msgs [19.2s]
Finished <<< cloisim_ros_base [8.90s]
Starting >>> cloisim_ros_camera
Starting >>> cloisim_ros_elevatorsystem
Starting >>> cloisim_ros_gps
Starting >>> cloisim_ros_lidar
Starting >>> cloisim_ros_micom
Starting >>> cloisim_ros_multicamera
Starting >>> cloisim_ros_realsense
Starting >>> cloisim_ros_world
Finished <<< cloisim_ros_camera [14.5s]
Starting >>> cloisim_ros_depthcamera
Finished <<< cloisim_ros_world [15.2s]
Finished <<< cloisim_ros_multicamera [15.3s]
Finished <<< cloisim_ros_gps [15.6s]
Finished <<< cloisim_ros_lidar [15.8s]
Finished <<< cloisim_ros_realsense [15.8s]
Finished <<< cloisim_ros_elevatorsystem [16.8s]
Finished <<< cloisim_ros_micom [22.3s]
Finished <<< cloisim_ros_depthcamera [8.86s]
Starting >>> cloisim_ros_bringup
--- stderr: cloisim_ros_bringup
In file included from /usr/include/websocketpp/transport/asio/base.hpp:31,
from /usr/include/websocketpp/transport/asio/connection.hpp:31,
from /usr/include/websocketpp/transport/asio/endpoint.hpp:32,
from /usr/include/websocketpp/config/asio_no_tls_client.hpp:32,
from /opt/lge-ros2/src/cloisim_ros/cloisim_ros_bringup/include/cloisim_ros_bringup/websocket_service.hpp:18,
from /opt/lge-ros2/src/cloisim_ros/cloisim_ros_bringup/src/websocket_service.cpp:15:
/usr/include/websocketpp/common/asio.hpp:56:14: fatal error: boost/version.hpp: No such file or directory
56 | #include <boost/version.hpp>
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/cloisim_ros_bringup.dir/build.make:63: CMakeFiles/cloisim_ros_bringup.dir/src/websocket_service.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
In file included from /usr/include/websocketpp/transport/asio/base.hpp:31,
from /usr/include/websocketpp/transport/asio/connection.hpp:31,
from /usr/include/websocketpp/transport/asio/endpoint.hpp:32,
from /usr/include/websocketpp/config/asio_no_tls_client.hpp:32,
from /opt/lge-ros2/src/cloisim_ros/cloisim_ros_bringup/include/cloisim_ros_bringup/websocket_service.hpp:18,
from /opt/lge-ros2/src/cloisim_ros/cloisim_ros_bringup/src/main.cpp:26:
/usr/include/websocketpp/common/asio.hpp:56:14: fatal error: boost/version.hpp: No such file or directory
56 | #include <boost/version.hpp>
| ^~~~~~~~~~~~~~~~~~~
compilation terminated.
make[2]: *** [CMakeFiles/cloisim_ros_bringup.dir/build.make:76: CMakeFiles/cloisim_ros_bringup.dir/src/main.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:78: CMakeFiles/cloisim_ros_bringup.dir/all] Error 2
make: *** [Makefile:141: all] Error 2

Failed <<< cloisim_ros_bringup [3.46s, exited with code 2]

Summary: 14 packages finished [46.5s]
1 package failed: cloisim_ros_bringup
1 package had stderr output: cloisim_ros_bringup
The command '/bin/bash -c source /opt/ros/${ROS_DISTRO}/setup.bash; colcon build --symlink-install' returned a non-zero code: 2

Bringup Task in Docker

안녕하세요. 시뮬레이터를 처음 사용해보면서 리드미에 있는 기능들을 하나씩 시도해는 중입니다. 아직 미숙해서 많이 헤매고 있습니다.
호스트 OS: Ubuntu 20.04
cloisim레포로부터 도커이미지를 빌드해서 도커컨테이너로 시뮬레이터를 실행하고 있습니다.
image

또한 cloisim_ros레포로부터 토커이미지를 빌드해서 컨테이너를 실행시키는 것도 성공했습니다.
아래는 cloisim컨테이너를 실행한 후 cloisim_ros컨테이너의 ros2 launch cloisim_ros_bringup bringup.launch.py $@명령어를 실행한 뒤의 출력입니다.
image

그런데 이렇게 작업을 마친 후 로봇이 움직이지 않는 것이 정상인가요?

+) teleop 패키지를 설치한 후 ros2 run teleop_twist_keyboard teleop_twist_keyboard __ns:=/cloi1 명령어를 통해서 키보드 커맨드로 로봇을 움직이는 것은 성공했습니다. cloisimcloisim_ros컨테이너의 통신이 잘 이루어지고 있다는 것은 확인된 듯 합니다.


`closim`의 리드미에 첨부된 동영상처럼 navigation2을 실행해보고 싶은데 이것은 어떻게 도커 환경에서 어떻게 해야 하는지 궁금합니다! README와 Wiki의 Usage를 최대한 따라해보려고 했으나 잘 모르겠습니다. Unity를 설치해서 디버깅모드로 돌리는 건가요?

읽어주셔서 감사합니다.

Cloisim Docker 연동

OS: MAC

Cloisim 프로젝트로 유니티 ROS간 인터페이스와 가상시뮬레이션을 시도 했습니다.

현재 프로젝트 상태는 Cloisim 유니티 파일을 받아서 올리고 실행시키면 sample_resource를 불러오도록하고
Cloisim_ros는 도커로 띄운 상태입니다.

처음 유니티에서의 가상 센서들 정보는 Ros에 잘넘어가는데 그다음 zmq에러가 뜹니다.
에러 메세지가 랭스-1로 뜨는걸로보아 메세지가 들어오지 않아서 그런것 같다는 추측이 되는데요
추가로 해줘야할게 있을까요?

유니티 상태는 어떤에러 메세지도 없고 가상클로이로봇들은 움직이지 않는 상태입니다.

관련 상태 이미지로 유첨드립니다.

Ros_Unity_interface
zmqError

Change dashing -> foxy in rosdep command line

Describe the bug
A clear and concise description of what the bug is.

To Reproduce
Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Expected behavior
A clear and concise description of what you expected to happen.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

Missing dependency: elevator_system_msgs

I cannot locate the elevator_system_msgs package anywhere (in this repo or elsewhere online) which is a requirement for closim_ros_elevatorsystem.

rosdep cannot locate the dependency and the build fails as a result.

Wrong LaserScan metadata

Describe the bug

The metadata of the LaserScan topic has incorrect values. This can be easily reproduced using slam_toolbox.

To Reproduce

  1. Run cloisim
  2. Run cloisim_ros
  3. Install slam_toolbox package and run ros2 launch slam_toolbox online_async_launch.py
  4. A message throwing an error appears:

[async_slam_toolbox_node-1] LaserRangeScan contains 1081 range readings, expected 1082

Expected behavior

No errors should be seen and the Tf between odom and map should be provided by SLAM Toolbox.

A way of fixing this issue can be seen here: https://github.com/allenh1/rplidar_ros/pull/18/files.


I used Docker to bringup Cloisim:

export CLOISIM_RESOURCES_PATH=$HOME/cloisim/sample_resources

xhost +
docker run -ti --rm --gpus all --net=host \
    -e DISPLAY \
    -v /tmp/.Xauthority:/tmp/.Xauthority \
    -v /tmp/cloisim/unity3d:/root/.config/unity3d \
    -v /tmp/.X11-unix:/tmp/.X11-unix  \
    -v /usr/share/fonts/:/usr/share/fonts/ \
    -v ${CLOISIM_RESOURCES_PATH}/media:/opt/resources/media/ \
    -v ${CLOISIM_RESOURCES_PATH}/meshes:/opt/resources/meshes/ \
    -v ${CLOISIM_RESOURCES_PATH}/models:/opt/resources/models/ \
    -v ${CLOISIM_RESOURCES_PATH}/photos:/opt/resources/photos/ \
    -v ${CLOISIM_RESOURCES_PATH}/worlds:/opt/resources/worlds/ \
    cloisim $1
export CLOISIM_BRIDGE_IP=$(ip addr show dev docker0 | grep "inet" | awk 'NR==1{print $2}' | cut -d'/' -f 1)
echo $CLOISIM_BRIDGE_IP

export ROS_DOMAIN_ID=22

docker run -it --rm \
    -e CLOISIM_BRIDGE_IP=$CLOISIM_BRIDGE_IP \
    -e ROS_DOMAIN_ID=$ROS_DOMAIN_ID \
    cloisim_ros $1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.