Commit dc74cea5 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

A hard-to-understand draft 1

parent f299009b
Pipeline #840 canceled with stages
# ros2-scripts # ros2-scripts
Mostly python3 scripts for multi-camera systems to init and work * Mostly python3 scripts for Elphel 393 multi-camera systems to init and work.
\ No newline at end of file * Can be run on PC as well.
* Do not need to be built as a ROS2 package. See instructions below for running on PC.
* The basic idea is there's a single master and multiple slaves. Master is responsible for:
* init, sequential or parallel - depending on the system configuration, e.g. a slave can be power up dependent on another slave.
* broadcast commands, e.g. some daemons on/off
* Example list of services (cam_* are slaves),:
~$ ros2 service list
* Master creates 2 nodes, e.g.:
~$ ros2 node list
## Instructions
### Camera
* To be included into ** for autorun
* To launch manually:
~$ ssh root@camera-ip
~# cd /etc/elphel393
~# python3
* To enable **master** node, edit the */etc/elphel393/ros2_config.xml*:
<node name='cam_101698' role='left'/>
<node name='cam_1467cd' role='pc'/>
<node>-tag is for slave cameras, where *name* attr is a prefix and the last 3 octets of the slave's MAC (eth0). *role* must not be '**master**', not yet very meaningful.
### PC
~$ source /opt/ros/<distro>/
~$ source ~/ros2_ws/install/ # must have ros2-interfaces installed
~$ cd repo-path
# make changes to ros2_config.xml
~$ python3
* Loads the deafult config xml (*ros2_config.xml*) and reads MAC (from /sys/class/net/(eth|wlp|enp))/address) - based on the MAC and prefix from config the slave node is named.
## Command line example for sending request to a service
~$ ros2 service call /master/cmd_all elphel_interfaces/StrReqStrRes "{'request':'ls -all'}"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment