ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Launching a rosbag record node on a remote machine

asked 2020-02-24 03:15:38 -0500

max11gen gravatar image

updated 2022-01-22 16:10:22 -0500

Evgeny gravatar image

I'm trying to launch a rosbag record node on a remote machine. The reason why I'm trying to do this, is because I want to have a synchronous recording of topics on two different machines. I am aware, that I could just record all topics on one machine, however, for some reason I am missing data, when I am doing so (if you have suggestions on how to solve that, I'd be happy to hear about them, too). My launch file record_bags.launch looks like this:

<launch>
    <machine name="comp2" address="10.0.0.1" user="user" env-loader="/home/user/catkin_ws/devel/remote_env_load.bash" default="false" />
    <node pkg="rosbag" type="record" name="record_kinect" machine="comp2" respawn="false" output="screen" args="--duration=5 -O /home/user/test.bag /topic3 /topic4" />
    <node pkg="rosbag" type="record" name="record_atis" respawn="false" output="screen" args="--duration=5 -O /home/user/test.bag /topic1 /topic2" />
</launch>

The remote_env_load.bash on the remote machine "comp2" looks like this:

#!/bin/bash
export ROS_IP=10.0.0.1
export ROS_MASTER_URI=10.0.0.2
source /opt/ros/melodic/setup.bash
source /home/user/catkin_ws/devel/setup.bash

Now when I use roslaunch record_bags.launch I get the following error:

error launching on [10.0.0.1-0, uri http://10.0.0.1:41387/]: ERROR: Traceback (most recent call last):
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/server.py", line 332, in launch
    succeeded, failed = runner.launch()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/launch.py", line 662, in launch
    self._setup()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/launch.py", line 637, in _setup
    launched = self._launch_master()
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/launch.py", line 400, in _launch_master
    validate_master_launch(m, self.is_core, self.is_rostest)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/launch.py", line 83, in validate_master_launch
    if not rosgraph.network.is_local_address(m.get_host()):
  File "/opt/ros/melodic/lib/python2.7/dist-packages/roslaunch/core.py", line 273, in get_host
    host, _ = rosgraph.network.parse_http_host_and_port(self.uri)
  File "/opt/ros/melodic/lib/python2.7/dist-packages/rosgraph/network.py", line 91, in parse_http_host_and_port
    raise ValueError('not a valid URL')
ValueError: not a valid URL

Launch of the following nodes most likely failed: rosbag/record

Does anyone have an idea on what is going wrong here?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-02-24 04:29:31 -0500

gvdhoorn gravatar image
export ROS_MASTER_URI=10.0.0.2

As the name of the variable implies, it should be set to a full URI, not just an IP.

So it should most likely be:

export ROS_MASTER_URI=http://10.0.0.2:11311

in your case.

edit flag offensive delete link more

Comments

Great thanks. If you don't mind, I'd have another little question to append: Is there a way to make sure these to records will start at the exact same time?

max11gen gravatar image max11gen  ( 2020-02-24 04:58:31 -0500 )edit

If you don't mind, I'd have another little question to append

actually: posting follow-up questions in comments on accepted answers is a bad idea. They have very low visibility. It'd be better to post a new question (and potentially referring back to this one in your new post).

gvdhoorn gravatar image gvdhoorn  ( 2020-02-24 05:13:50 -0500 )edit

You are right. I just posted another question. Thanks for your help, and feel free to remove these comments.

max11gen gravatar image max11gen  ( 2020-02-24 05:28:54 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2020-02-24 03:15:38 -0500

Seen: 745 times

Last updated: Feb 24 '20