Difference between revisions of "ROS2"
From ElphelWiki
(→Workflow) |
|||
(16 intermediate revisions by the same user not shown) | |||
Line 39: | Line 39: | ||
===Notes=== | ===Notes=== | ||
+ | * Cross-compilation for ARM | ||
* ROS2 for python populates '''/usr/lib/python3.5/site-packages/''' so python scripts can live anywhere. | * ROS2 for python populates '''/usr/lib/python3.5/site-packages/''' so python scripts can live anywhere. | ||
* For command line apps, like ''ros2 ...'', if AMENT_PREFIX_PATH is not set then: | * For command line apps, like ''ros2 ...'', if AMENT_PREFIX_PATH is not set then: | ||
Line 72: | Line 73: | ||
===Installation=== | ===Installation=== | ||
* Google and follow the [https://index.ros.org/doc/ros2/ general instructions]. | * Google and follow the [https://index.ros.org/doc/ros2/ general instructions]. | ||
− | + | ||
+ | ===Notes=== | ||
* '''apt install ros-bouncy-desktop''' available in 18.04, <font color='red'>n/a in 16.04</font> | * '''apt install ros-bouncy-desktop''' available in 18.04, <font color='red'>n/a in 16.04</font> | ||
− | * '''apt install ros-ardent-desktop''' available in 16.04 | + | * '''apt install ros-ardent-desktop''' available in 16.04 |
− | + | * ROS2 will get installed to '''/opt/ros/<name>''', <name>s are ''ardent'', ''bouncy'', ''crystal'', etc. | |
− | |||
− | * ROS2 will get installed to '''/opt/ros/<name>''', <name> | ||
* Terminal setup: | * Terminal setup: | ||
<font size='2'>''source /opt/ros/bouncy/setup.bash'' | <font size='2'>''source /opt/ros/bouncy/setup.bash'' | ||
Line 83: | Line 83: | ||
''source /opt/ros/bouncy/local_setup.bash''</font> | ''source /opt/ros/bouncy/local_setup.bash''</font> | ||
+ | ===Workflow=== | ||
* Create a workspace | * Create a workspace | ||
* Create some packages inside or clone - they have a [https://github.com/dirk-thomas/vcstool vcs tool] to clone all repos from a text file. | * Create some packages inside or clone - they have a [https://github.com/dirk-thomas/vcstool vcs tool] to clone all repos from a text file. | ||
* Install [https://colcon.readthedocs.io/en/released/user/quick-start.html colcon] | * Install [https://colcon.readthedocs.io/en/released/user/quick-start.html colcon] | ||
* Then build with colcon | * Then build with colcon | ||
− | * | + | * New packages will not get installed to '''/opt/ros/<name>'''. They will live in their folders. |
* To use a package: | * To use a package: | ||
− | source /opt/ros/bouncy/setup.bash | + | <font size='2'>source /opt/ros/bouncy/setup.bash |
source ~/ros2_ws/some-package/install/local_setup.bash | source ~/ros2_ws/some-package/install/local_setup.bash | ||
ros2 pkg list | ros2 pkg list | ||
− | then run anything in this terminal | + | then run anything in this terminal</font> |
* Python scripts can live anywhere - just run them from that sourced terminal | * Python scripts can live anywhere - just run them from that sourced terminal | ||
− | + | ||
+ | ==<font color='blue'>ROS2 in Docker</font>== | ||
+ | docker pull osrf/ros2:bouncy-desktop | ||
+ | docker run -i -t osrf/ros2:bouncy-desktop | ||
+ | No network, no colcon, no ament... | ||
==<font color='blue'>ROS2 General Notes</font>== | ==<font color='blue'>ROS2 General Notes</font>== | ||
===Notes=== | ===Notes=== | ||
* SROS is Secure ROS or something | * SROS is Secure ROS or something | ||
+ | |||
===Useful links=== | ===Useful links=== | ||
− | * [http://docs.erlerobotics.com/robot_operating_system/ros2 | + | |
− | + | * [http://docs.erlerobotics.com/robot_operating_system/ros2 ErleRobotics Tutorials on ROS2] - very useful | |
− | * [https://index.ros.org/doc/ros2/Ament-Tutorial/ Ament tutorial] - will not work for PC because | + | |
− | * [https://index.ros.org/doc/ros2/Colcon-Tutorial/ Colcon tutorial] - | + | * [https://index.ros.org/doc/ros2/Ament-Tutorial/ Ament tutorial] - build system for new packages |
− | * [https:// | + | ** works and supported in meta-ros |
− | + | ** will not work for PC because repo hashes moved on? | |
+ | |||
+ | * [https://index.ros.org/doc/ros2/Colcon-Tutorial/ Colcon tutorial] - newest build system for new packages | ||
+ | ** works for PC, even in 16.04 | ||
+ | ** not supported in meta-ros (as of 2018/12/07) | ||
+ | ** [https://colcon.readthedocs.io/en/released/user/how-to.html#build-only-a-single-package-or-selected-packages colcon docs] | ||
+ | |||
+ | * [https://discourse.ros.org/search?q=meta-ros%20order%3Alatest About meta-ros] and [https://discourse.ros.org/search?q=meta-ros2%20order%3Alatest about meta-ros2] - are they merged? | ||
+ | |||
+ | Networking: | ||
+ | |||
* [http://design.ros2.org/articles/ros_on_dds.html ROS on DDS] | * [http://design.ros2.org/articles/ros_on_dds.html ROS on DDS] | ||
<font size='2'>... | <font size='2'>... | ||
Line 114: | Line 130: | ||
* [http://www.eprosima.com/index.php/resources-all/performance/40-eprosima-fast-rtps-performance FastRTPS benchmarks] | * [http://www.eprosima.com/index.php/resources-all/performance/40-eprosima-fast-rtps-performance FastRTPS benchmarks] | ||
* [http://docs.eprosima.com/en/latest/advanced.html FastRTPS max message size] | * [http://docs.eprosima.com/en/latest/advanced.html FastRTPS max message size] | ||
+ | * [https://erlerobotics.gitbooks.io/erle-robotics-python-gitbook-free/udp_and_tcp/a_simple_tcp_client_and_server.html Good book about UDP?] | ||
+ | |||
+ | ROS2 Services: | ||
+ | |||
* [https://wiki.ros.org/Services Request-Response is done with '''service''']. Format [https://wiki.ros.org/srv srv] | * [https://wiki.ros.org/Services Request-Response is done with '''service''']. Format [https://wiki.ros.org/srv srv] | ||
+ | * [https://discourse.ros.org/t/suggestions-for-std-srvs/1079/16 STD-SRVS '''discussion'''] & [https://github.com/ros2/examples/issues/4 ROS2 examples(?)] | ||
− | === | + | ===Reference ROS repos=== |
− | + | * [https://github.com/inertialsense/inertial_sense_ros.git inertial_sense_ros.git] - cpp | |
− | + | * [https://github.com/intel/ros2_intel_realsense.git ros2_intel_realsense.git] - cpp | |
− | + | * [https://github.com/ros-drivers/axis_camera.git axis_camera.git] - python | |
− | + | * [https://github.com/bmwcarit/meta-ros.git meta-ros.git] - layer for Yocto | |
==<font color='blue'>ROS1</font>== | ==<font color='blue'>ROS1</font>== | ||
<font color='red'>'''Won't build'''</font>. [[ROS1|More info]]. | <font color='red'>'''Won't build'''</font>. [[ROS1|More info]]. |
Revision as of 12:41, 10 December 2018
Contents
About
Use ROS2 in Elphel single or multi-camera systems. The cameras are 10393 system boards based on Xilinx Zynq, ARM.
Goals
Notes:
- Controlling and initializing of multi-camera systems is already implemented using PHP API (autocampars.php), Python and lighttpd.
- Using ROS2 is intended to simplify/standardize the above.
- Using ROS2 is intended to make cameras compatible with other hardware supported by ROS1/2.
Having ROS2 cross-compiled and installed on each camera:
- Initialize cameras in a pre-defined multi-camera system - sync and sequence critical init
- Control multiple cameras from any camera of the system - parameters, recording
- Control multiple cameras from a PC (with ROS2 for PC installed).
- Control multiple cameras from a network device (w/o ROS2 installed, but with a browser) - by accessing a web server running on a camera interfaced with ROS2 of the camera. Can use nodejs or just lighttpd+php.
Status
Development
Interfaces
ROS2 nodes communicate over:
- 1 GigE LAN or (possibly) wifi (camera1-camera2..N, pc-camera1..N, pc1-pc2..M)
- within a single device
Notes:
- image sensors, IMS (or GPS & IMU), any other sensors are attached to cameras via a custom interface or USB, with appropriate driver support.
- normally cameras in the system are synced with a custom trigger cable - this is setup over network
- any device attached to PC?
ROS2 on Zynq
Installation
- For Embedded Linux (but not Ubuntu Distro) use meta-ros.git. What about meta-ros2?
TODO: Include meta-ros.git in elphel393 build system.
Include meta-ros to elphel393
- Add path to bblayers.conf
- Add to "IMAGE_INSTALL_append" of core-image-elphel393.bb:
packagegroup-ros2-world \
Notes
- Cross-compilation for ARM
- ROS2 for python populates /usr/lib/python3.5/site-packages/ so python scripts can live anywhere.
- For command line apps, like ros2 ..., if AMENT_PREFIX_PATH is not set then:
OSError: Environment variable 'AMENT_PREFIX_PATH' is not set or empty
- Useful commands (command line):
export AMENT_PREFIX_PATH=/usr
ros2 pkg list ros2 node list ros2 srv list ros2 srv show std_srvs/Trigger ros2 msg list ros2 msg show std_msgs/String
Demos
talker-listener cpp
# terminal 1: export AMENT_PREFIX_PATH=/usr ros2 run demo_nodes_cpp talker # terminal 2: export AMENT_PREFIX_PATH=/usr ros2 run demo_nodes_cpp listener
Workflow
- Use example recipes from meta-ros.git
- bitbake package-name, check output and logs in the poky build tree
- List package in core-image-elphel393.bb's IMAGE_INSTALL_append
TODO:
- Add target-scp and an example empty recipe
ROS2 on PC
Installation
- Google and follow the general instructions.
Notes
- apt install ros-bouncy-desktop available in 18.04, n/a in 16.04
- apt install ros-ardent-desktop available in 16.04
- ROS2 will get installed to /opt/ros/<name>, <name>s are ardent, bouncy, crystal, etc.
- Terminal setup:
source /opt/ros/bouncy/setup.bash or source /opt/ros/bouncy/local_setup.bash
Workflow
- Create a workspace
- Create some packages inside or clone - they have a vcs tool to clone all repos from a text file.
- Install colcon
- Then build with colcon
- New packages will not get installed to /opt/ros/<name>. They will live in their folders.
- To use a package:
source /opt/ros/bouncy/setup.bash source ~/ros2_ws/some-package/install/local_setup.bash ros2 pkg list then run anything in this terminal
- Python scripts can live anywhere - just run them from that sourced terminal
ROS2 in Docker
docker pull osrf/ros2:bouncy-desktop docker run -i -t osrf/ros2:bouncy-desktop No network, no colcon, no ament...
ROS2 General Notes
Notes
- SROS is Secure ROS or something
Useful links
- ErleRobotics Tutorials on ROS2 - very useful
- Ament tutorial - build system for new packages
- works and supported in meta-ros
- will not work for PC because repo hashes moved on?
- Colcon tutorial - newest build system for new packages
- works for PC, even in 16.04
- not supported in meta-ros (as of 2018/12/07)
- colcon docs
- About meta-ros and about meta-ros2 - are they merged?
Networking:
... if you are concerned about latency, like for soft real-time, you can basically tune DDS to be just a UDP blaster. In another scenario you might need something that behaves like TCP, but needs to be more tolerant to long dropouts, and with DDS all of these things can be controlled by changing the QoS parameters. ...
ROS2 Services:
Reference ROS repos
- inertial_sense_ros.git - cpp
- ros2_intel_realsense.git - cpp
- axis_camera.git - python
- meta-ros.git - layer for Yocto
ROS1
Won't build. More info.