0
$\begingroup$

Rosanswers logo

Hello all,

I'm trying to use a Raspberry Pi 3 as a ROS node, publishing a topic containing a point-cloud, generated by an Orbbec Astra RGBD camera.

The Raspberry Pi 3 is running Ubuntu Mate Xenial, with ROS Kinetic installed, and Orbbec's ROS packages (ros_camera_astra and ros_camera_launch) cloned and built. I can happily use roslaunch astra_launch astra.launch to run up a local ROS master and node, publishing the point cloud (amongst other data).

The machine I want to use as a master is running Ubuntu Trusty, with ROS indigo installed. It also has Orbbec's ROS packages installed, and can successfully roslaunch astra_launch astra.launch. My goal is to run the Astra node on the Pi 3, and view the published data in Rviz on the master machine. This is the launch file I am attempting to use on the master machine:

<launch>
  <node name="rviz" pkg="rviz" type="rviz" />
  <group>
    <machine name="pi" address="pi.local" user="ethan" env-loader="/opt/ros/kinetic/env.sh" default="true" />
    <include file="$(find astra_launch)/launch/astra.launch" />
  </group>
</launch>

I can ping and passwordlessly ssh into pi.local from the master, so the networking seems happy. However, the output I get from attempting to launch the above launch file is:

... logging to /home/ethan/.ros/log/5ec6008c-f836-11e6-8d11-d0509948ac7c/roslaunch-ethan-desktop-15179.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://ethan-desktop:43663/
remote[pi.local-0] starting roslaunch
remote[pi.local-0]: creating ssh connection to pi.local:22, user[ethan]
launching remote roslaunch child with command: [env ROS_MASTER_URI=http://ethan-desktop:11311 /opt/ros/kinetic/env.sh roslaunch -c pi.local-0 -u http://ethan-desktop:43663/ --run_id 5ec6008c-f836-11e6-8d11-d0509948ac7c]
remote[pi.local-0]: ssh connection created

SUMMARY
========

PARAMETERS
 * /camera/camera_nodelet_manager/num_worker_threads: 4
 * /camera/depth_rectify_depth/interpolation: 0
 * /camera/depth_registered_rectify_depth/interpolation: 0
 * /camera/driver/auto_exposure: True
 * /camera/driver/auto_white_balance: True
 * /camera/driver/bootorder: 0
 * /camera/driver/color_depth_synchronization: False
 * /camera/driver/depth_camera_info_url: 
 * /camera/driver/depth_frame_id: camera_depth_opti...
 * /camera/driver/depth_registration: True
 * /camera/driver/device_id: #1
 * /camera/driver/devnums: 1
 * /camera/driver/rgb_camera_info_url: 
 * /camera/driver/rgb_frame_id: camera_rgb_optica...
 * /rosdistro: indigo
 * /rosversion: 1.11.20

MACHINES
 * pi

NODES
  /camera/
    camera_nodelet_manager (nodelet/nodelet)
    depth_metric (nodelet/nodelet)
    depth_metric_rect (nodelet/nodelet)
    depth_points (nodelet/nodelet)
    depth_rectify_depth (nodelet/nodelet)
    depth_registered_hw_metric_rect (nodelet/nodelet)
    depth_registered_metric (nodelet/nodelet)
    depth_registered_rectify_depth (nodelet/nodelet)
    driver (nodelet/nodelet)
    points_xyzrgb_hw_registered (nodelet/nodelet)
    rgb_rectify_color (nodelet/nodelet)
  /
    camera_base_link (tf/static_transform_publisher)
    camera_base_link1 (tf/static_transform_publisher)
    camera_base_link2 (tf/static_transform_publisher)
    camera_base_link3 (tf/static_transform_publisher)
    rviz (rviz/rviz)

auto-starting new master
process[master]: started with pid [15202]
ROS_MASTER_URI=http://ethan-desktop:11311

setting /run_id to 5ec6008c-f836-11e6-8d11-d0509948ac7c
process[rosout-1]: started with pid [15215]
started core service [/rosout]
process[rviz-2]: started with pid [15230]
error launching on [pi.local-0, uri http://pi:57893/]: Name or service not known
Launch of the following nodes most likely failed: nodelet/nodelet, nodelet/nodelet, nodelet/nodelet, nodelet/nodelet, nodelet/nodelet, nodelet/nodelet, nodelet/nodelet, nodelet/nodelet, nodelet/nodelet, nodelet/nodelet, nodelet/nodelet, tf/static_transform_publisher, tf/static_transform_publisher, tf/static_transform_publisher, tf/static_transform_publisher

Any suggestions? Possibly an issue with Indigo-Kinetic interoperability? Or x64-ARM interoperability?

Many thanks for any help offered.


Originally posted by Ethan on ROS Answers with karma: 71 on 2017-02-21

Post score: 1

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Ok, solved it.

So the env-loader="/opt/ros/kinetic/env.sh" in my launch file was telling the ROS to run the default ROS setup on the remote machine (pi). Two problems with this: firstly, my workspace (~/catkin_ws) was not in ROS_PACKAGE_PATH, and secondly, the remote was using the hostname pi, rather than pi.local, as our office DHCP/DNS server refers to the pi machine as. To solve these problems, I created the following at ~/catkin_ws/env.sh on the pi:

#!/bin/bash
source /opt/ros/kinetic/setup.bash
source /home/ethan/catkin_ws/devel/setup.bash
export ROS_HOSTNAME="pi.local"
exec "$@"

And modified the launch file on the master to read env-loader="/home/ethan/catkin_ws/env.sh"

So now, when pi is used as a remote, first the ROS installation and my workspace are added to the ROS_PACKAGE_PATH, then the ROS_HOSTNAME environment variable is manually set to pi.local.

Everything works now. Hopefully this will be of use to someone.


Originally posted by Ethan with karma: 71 on 2017-02-21

This answer was ACCEPTED on the original site

Post score: 6


Original comments

Comment by gvdhoorn on 2017-02-21:
Thanks for reporting how you solved it.

A note: you only need to source the 'top-most' workspace, so in your case that would be $HOME/catkin_ws. Sourcing the Kinetic distribution setup.bash is not needed (provided that you had it sourced when you built your ws, but you probably had).

Comment by robotpan on 2018-02-27:
Thank you for reporting your solution! It's very helpful.

Comment by jaiswalharsh on 2020-07-30:
I have a similar setup and my master (my laptop) wont even find the launch file on the pi. It tries to find the launch file on my local workspace and fails. Is it necessary to have all the same packages as on pi on my local pc (master) as well?

Comment by Ethan on 2020-07-30:
Hi, when you say It tries to find the launch file on my local workspace and fails, what's telling you that?

Do you have the same launch file layout as above? i.e.:

<group>
  <machine name="pi" address="pi.local" user="ethan" env-loader="/opt/ros/kinetic/env.sh" default="true" />
  <include file="$(find astra_launch)/launch/astra.launch" />
</group>

Obviously replacing name, address, user, and the launch file with the one you want.

Comment by gvdhoorn on 2020-07-30:\

my master (my laptop) wont even find the launch file on the pi. It tries to find the launch file on my local workspace and fails. Is it necessary to have all the same packages as on pi on my local pc (master) as well?

From wiki/roslaunch/XML:

Substitution args are currently resolved on the local machine. In other words, environment variables and ROS package paths will be set to their values in your current environment, even for remotely launched processes.

Comment by Rufus on 2021-02-10:
See this answer for a workaround in the case where the package/node/launch file is ONLY available on remote

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.