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

XDGFX's profile - activity

2022-01-17 17:21:00 -0500 received badge  Famous Question (source)
2022-01-17 17:21:00 -0500 received badge  Notable Question (source)
2021-07-21 07:35:59 -0500 received badge  Enthusiast
2021-07-15 10:13:53 -0500 received badge  Popular Question (source)
2021-07-14 03:36:59 -0500 marked best answer Docker-Compose won't launch ros node, but Docker run will

I'm having a strange issue running a ROS Melodic node inside a Docker container.

Within the container I want to launch row_follower.launch inside the navvy_row package. If I run the container with a command argument, docker run --rm -it --net host navvy_row roslaunch navvy_row row_follower.launch, the node starts without issue:

... logging to /root/.ros/log/a5064c4a-e3e2-11eb-b627-48b02d0788d9/roslaunch-nanoboi-235.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://nanoboi:45713/

SUMMARY
========

PARAMETERS
 * /ransac_row_followerv2/LeftRightThreshold: 0.8
 * /ransac_row_followerv2/PPMultiplier: 5
...

However if I try the same using docker-compose and the below entry:

  navvy_row:
    container_name: navvy_row
    image: navvy_row
    build: navvy_row/
    network_mode: host
    command: roslaunch navvy_row row_follower.launch

I get no output past the echo from /ros_entrypoint.sh. I know the workspace is sourced correctly because replacing the command: with rospack find navvy_row returns the location as expected.

Attaching to the container and launching the launchfile starts as expected, but then the original docker-compose logs show an error because two nodes were registered with the same name, starts loading the new node and then the whole container exits.

navvy_row    | [ WARN] [1626185169.544579230]: Shutdown request received.
navvy_row    | [ WARN] [1626185169.544793054]: Reason given for shutdown: [[/ransac_row_followerv2] Reason: new node registered with same name]
navvy_row    | [ INFO] [1626185126.115699876]: Starting ransac row node
navvy_row    | [ INFO] [1626185126.259093209]: Finished Setup, Starting Spinning
...

If I don't start roscore on the host before trying to launch the container, if it's the only container the same thing happens (nothing).

If I have another ros1 container running it seems to sometimes get further but always results in an error from one of the containers:

RLException: run_id on parameter server does not match declared run_id: 13e8b156-e3e4-11eb-b345-48b02d0788d9 vs 13e26936-e3e4-11eb-8394-48b02d0788d9

I've run out of ideas on how to fix this, any help much appreciated!

2021-07-14 03:19:16 -0500 answered a question Docker-Compose won't launch ros node, but Docker run will

I think I've found a solution from here. Adding tty: true seems to solve the problem, and the container starts as expec

2021-07-14 03:19:16 -0500 received badge  Rapid Responder (source)
2021-07-14 03:05:30 -0500 commented question Docker-Compose won't launch ros node, but Docker run will

This is the contents of the .launch file: <?xml version="1.0"?> <launch> <node pkg="navvy_row" name="

2021-07-13 11:53:02 -0500 received badge  Student (source)
2021-07-13 11:51:02 -0500 asked a question Docker-Compose won't launch ros node, but Docker run will

Docker-Compose won't launch ros node, but Docker run will I'm having a strange issue running a ROS Melodic node inside a