Difficulty Accessing The ROS API

Hi,
I’m trying to use the online documentation for the API Access Levels (https://tormach.atlassian.net/wiki/x/G4BAhg). More specifically, I would like to access the ROS publisher topics for the robots’ joint_states_throttle or pose_states_throttle. I’m having no success. It’s probably something simple, but I can’t figure it out.

Attempting to follow the documentation, if I open a terminal (outside of PathPilot) and literally enter “docker exec -itu 1000:1000 ros-dist-ui bash -i”, it will return “Error: No such container: ros-dist-ui”

If I try “docker exec -itu 1000:1000 noetic bash -i”, it will return “Error: No such container: noetic”
(NOTE: I’m under the impression that it’s ROS Noetic)

Do I open a terminal (somewhere?) and enter this command, or do I enter it somewhere in the PathPilot interface? The documentation states “Run the following command on the robot computer to open a terminal in the robots Docker container.” Where does this command need to be entered, specifically? And anything else I should do to be able to subscribe to the publisher node?

Thanks for any help you can provide,

Mike

Hi Mike, sorry you are having troubles with this.

I’ll try to see f we can’t update the documentation to be a little clearer, but the piece(s) you might be missing:

  • You need to start the Robot UI first (past the launcher).
  • You want to docker exec into that running container.

Specific to #2: It appears we’ve changed the default name of the container since those docs were created. The name is now version specific, so the better way to handle this might be:

1.) Start a terminal (so it’s easy to alt-tab back to)
2.) Start a PathPilot Robots UI. Wait until it launches.
3.) In the terminal do a docker ps to see the running containers. Copy the container ID from the container with a name similar to docker.pathpilot.com/ros_public:noetic-dist-focal-237.50559d8e.
4.) In the terminal run docker exec -itu 1000:1000 <ID_FROM_STEP_3> bash -i

Proceed from there to list out the topics as described in the Wiki article (source, rostopic, etc.)

rsteckman,
Thanks for the reply. I tried your suggestion and it worked. I’m further along in the process, but still having some issues.

In a terminal I did a “docker ps” to list the container(s). You can see the return below:

I tried the following using the two different container ID’s (each at a separate time in a separate terminal; neither seemed to make a difference):

I ran “docker exec -itu 1000:1000 [docker container ID] bash -i

Then I sourced the setup.bash: “source /opt/ros/noetic/setup.bash

Next I ran “rostopic list”; this gave me a long list of ros topics.

When I ran “rostopic echo /joint_states_throttle” it returned the following:
Network communication failed. Most likely failed to communicate with master.

A little research suggested to me that perhaps the ROS MASTER was not running, so I tried “roscore”.

This returned the following:

(1) Is ROSCORE not running, but needs to be?
(2) If the answer is yes, do I do this as root? If so, what is the root password?
(3) If it’s something else (and I’m way off), what should I try next?

Thanks

Hi Mike,

Sorry for the delay in my response, and for not walking through the entire process to ensure it worked before I sent it over to you.

The ROS Master is definitely running if you are inside the container like you were, but it looks like the environment didn’t load in properly.

Try replacing my step #4 with this:
docker exec -it <ID_FROM_STEP_3> bash -i

Removing the user param to docker exec not only cleans up the shell (so you don’t see the “I have no name” in the prompt) but actually allows the environment to load correctly.

Once you do that, you should be able to echo $ROS_MASTER_URI and see a response. For me when I just tested this, I saw http://localhost:11311.
If for whatever reason this is not set, you can set it to either “localhost” or “127.0.0.1” like mentioned in the wiki by using:
export ROS_MASTER_URI=http://localhost:11311.

After I verified the ROS_MASTER_URI environment variable as above, ran the command you has issues with communication on:
rostopic echo /joint_states_throttle

Doing that gave me continuous stream of output on the status of the joints that looked like this:

  seq: 35751
  stamp: 
    secs: 1721680862
    nsecs: 321113277
  frame_id: ''
name: 
  - joint_1
  - joint_2
  - joint_3
  - joint_4
  - joint_5
  - joint_6
  - tcp_lin
  - tcp_rot
position: [-0.08649356290769912, 0.30872350467324994, -0.05515260178649861, -0.3327322789264078, -0.26761543781837827, 0.32170165847062093, 9.999999999976697e-05, 0.0]
velocity: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
effort: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
---

This continued until I Ctrl-C’d in the terminal to stop the output. It did correctly update to the machine’s values when I jogged the robot (note: I was running in Sim when I did this).

Let me know if you continue to have any difficulties.

Ryan, that did the trick. Thanks so much.