TO BE UPDATED. GUIDE MIGHT STILL WORK.
The scripts to source the ROS-builds on both the RPi and VM expect paths in which a package is build.
Both ros-native and ros-cross search for the devel*
folders created bij the ROS builders.
For native building, packages need to be build in:
XCS~$ ~/build/ros/<packagename>
For cross compilation, packages need to be build in:
XCS~$ ~/ros/<packagename>_cross
After cross-compiling a package for the RPi, the ~/ros
directory needs to be synchronised with the RPi via:
XCS~$ ~/rpicross_notes/scripts/sync-ros.sh
The source of a package can be located everywhere.
Optional:
XCS~$ source ~/rpicross_notes/scripts/ros-native
XCS~$ mkdir -p ~/build/ros/<packagename>
XCS~$ cd ~/build/ros/<packagename>
XCS~$ cmake <path>/<to>/<package>
XCS~$ make
XCS~$ source ~/rpicross_notes/scripts/ros-native <hostname> <rpiname>
<hostname>
and `are optional and only needed when a RPi is used. See [Testing](/rpicross_notes/10-ros-remote.html#testing).
XCS~$ source ~/build/ros/<packagename>/devel/setup.bash
roscore
is running, the package can be started via rosrun
:
XCS~$ rosrun <packagename> <node>
XCS~$ source ~/rpicross_notes/scripts/ros-cross
XCS~$ mkdir -p ~/ros/<packagename>
XCS~$ cd ~/ros/<packagename>
XCS~$ cmake \
-DCMAKE_TOOLCHAIN_FILE=/home/pi/rpicross_notes/rpi-generic-toolchain.cmake \
<path>/<to>/<package>
XCS~$ make
XCS~$ ~/rpicross_notes/scripts/sync-ros.sh <rpi-host>
<rpi-host>
is optional. When omitted,rpizero-local
is used.
roscore
is running, the package can be started via rosrun
:
XCS~$ ssh rpizero-local
RPi~$ rosrun <packagename> <node>
When a mixed setup is used, e.g. when both the VM and RPi need to be active, the following command should be executed before logging-in to the RPi or starting a node on either the VM or RPi:
XCS~$ source ~/rpicross_notes/scripts/ros-native <hostname> <rpiname>
<hostname>
: hostname of device on which roscore
runs.
HOST~$
detect the hostname with the
hostname
command
<rpiname>
: name of ssh-connection defined in ssh_config
of the RPi