remote launch failure on Jetson

asked 2021-03-19 09:55:25 -0500

Galto2000 gravatar image

Howdy folks,

I have a laptop and a Jetson Xavier NX on the same gig-network.

I wish to replay ROS bags of sensor inputs and run RVIZ on the laptop while the ROS system under test runs on the Jetson (and acting on the messages from the ROS bag whilst outputting messages being visualized on RVIZ on the laptop).

I am getting the following error when I start the launch file on my laptop:

RLException: ERROR: unable to contact ROS master at [http://192.168.88.237:11311] The traceback for the exception was written to the log file

Note that my environment variables for the ROS master have been setup correctly below (or at least, I have convinced myself that to be the case), so I am puzzled as to what is going on. I am currently trying to wrap my head around the innards of roslaunch, so I am not even sure if it's failing on the laptop or on the jetson, but if someone has any suggestions or ideas as to what might be going on, I would be very appreciative and happy to hear them :)

Below are all the details,

Thanks in advance

Galto

My setup:

Laptop (promethium) has IP addr 192.168.88.251, Jetson (lunium) has IP addr 192.168.88.237 and is ROS master.

Laptop environment variables:

ROS_ETC_DIR=/opt/ros/melodic/etc/ros
ROS_MASTER_IP=192.168.88.237
ROS_ROOT=/opt/ros/melodic/share/ros
ROS_MASTER_URI=http://192.168.88.237:11311
ROS_VERSION=1
ROS_PYTHON_VERSION=2
ROS_IP=192.168.88.251
ROS_PACKAGE_PATH=/home/bg/src/catkin_ws/src:/home/bg/src/luna-vehicle/catkin_ws/src:/opt/ros/melodic/share
ROSLISP_PACKAGE_DIRECTORIES=/home/bg/src/catkin_ws/devel/share/common-lisp:/home/bg/src/luna-vehicle/catkin_ws/devel/share/common-lisp
ROS_DISTRO=melodic

Note that the environment variable ROS_MASTER_IP is my own custom environment variable that indicates the IP address of the Jetson, and that is used in the launch file as shown below in order to assign the machines.

Jetson Environment variables:

ROS_ETC_DIR=/opt/ros/melodic/etc/ros
ROS_ROOT=/opt/ros/melodic/share/ros
ROS_MASTER_URI=http://192.168.88.237:11311
ROS_VERSION=1
ROS_PYTHON_VERSION=2
ROS_IP=192.168.88.237
ROS_PACKAGE_PATH=/opt/ros/melodic/share
ROSLISP_PACKAGE_DIRECTORIES=
ROS_DISTRO=melodic

My Launch file:

<launch>
    <arg name="use_bag" default="false"/>
    <arg name="bag_path" default=""/>
    <arg name="rviz" default="false"/>

    <machine name="jetson" address="$(env ROS_MASTER_IP)" env-loader="/opt/ros/melodic/env.sh" user="luna" timeout="10.0" default="true"/>
    <machine name="laptop" address="$(env ROS_IP)"  env-loader="/opt/ros/melodic/env.sh" timeout="10.0"/>

    <!-- Play Bag to run on laptop -->
    <node if="$(arg use_bag)" pkg="rosbag" type="play" name="player" output="screen" machine="laptop" args="--clock $(arg bag_path)"/>

    <!-- RViz to run on laptop -->
    <node if="$(arg rviz)" pkg="rviz" type="rviz" name="$(anon rviz)" respawn="false" output="screen" args="-d $(find obstacle_detection)/rviz/od_live.rviz" machine="laptop"/>

    <!-- Localization to run on Jetson (by default) -->
    <node pkg="bandicoot" type="bandicoot_ros_node" name ...
(more)
edit retag flag offensive close merge delete

Comments

When I make my laptop the ROS master, instead of the Jetson, then it all works as expected.

The machine that is starting the launch file, also starts roscore, and as such, in my first configuration where the Jetson is the ROS master and where I start the remote launch file on the laptop, roscore isn't running on the master but on the laptop, however ROS is looking for roscore on the master and thus throwing that exception.

Is there a way to ensure that roscore starts on the remote Jetson which is configured as ROS master, while starting the remote launch file on the laptop?

Galto2000 gravatar image Galto2000  ( 2021-03-22 08:35:38 -0500 )edit