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

akim's profile - activity

2023-03-19 07:42:40 -0500 received badge  Famous Question (source)
2022-12-20 03:13:31 -0500 received badge  Notable Question (source)
2022-12-20 03:03:33 -0500 marked best answer ROS in Docker: messaging with host PC

Hi!
I would like to know how to set up connection between ROS in Docker with ROS on host PC correctly.
Following some answers like these [1][2] I can understand that connecting container to host network and exporting proper environmental variables should be enough.
However, when I try pub/echo between container and host PC, I get no response

Here is how I start everything:
On host PC I have the following in my .bashrc:

ROS_HOSTNAME=192.168.1.1
ROS_MASTER_URI=http://192.168.1.1:11311/
ROS_IP=192.168.1.1

Then I start roscore in the first terminal. In the second terminal I run:
docker run --net=host --name ros-test -it --rm osrf/ros:noetic-desktop

And in the resulting second terminal I export the same environmental variables as shown above. Then I inspect available topics with rostopic list and can see default topics when roscore in running:

/rosout
/rosout_agg

Then in the third terminal from host PC I try simple publish command:
rostopic pub -r 1 /test std_msgs/String "halo"

Then try to receive messages in the container which is the second terminal: rostopic echo /test I expect to receive messages, but there is nothing coming. When I do rostopic hz /test, it says "no new messages"
When I check rostopic info /test from fourth terminal I get the folllowing:

Type: std_msgs/String
Publishers:
* /rostopic_178825_1670943581897 (http://risc-SYS-5049A-TR:33815/)
Subscribers:
* /rostopic_111_1670945011845 (http://docker-desktop:57739/)

With publisher being my third terminal and subscriber being my second terminal which is container

Is there something wrong with how I am doing things? Please advise or help

2022-12-20 03:03:32 -0500 received badge  Scholar (source)
2022-12-20 03:03:20 -0500 answered a question ROS in Docker: messaging with host PC

So I figured out it was my dumb mistake I was following these instructions, but, apparently, I somehow skipped step (3)

2022-12-19 03:50:46 -0500 received badge  Student (source)
2022-12-14 23:34:50 -0500 received badge  Popular Question (source)
2022-12-13 09:30:03 -0500 asked a question ROS in Docker: messaging with host PC

ROS in Docker: messaging with host PC Hi! I would like to know how to set up connection between ROS in Docker with ROS

2022-07-14 03:01:17 -0500 received badge  Enthusiast
2020-06-27 03:13:30 -0500 commented answer Set delay between starting nodes within launch file

This saved my day! I was doing delays with timed_roslaunch before, but creating a launch file for every node was a bit p

2020-06-27 03:13:03 -0500 commented answer Set delay between starting nodes within launch file

This saved my day! I was doing delays with timed_roslaunch before, but creating a launch file for every node was a bit p

2020-05-19 05:33:24 -0500 answered a question uvc_camera select timeout in grab

I've got the same problem, but I don't know how to solve the problem Apparently, it is caused because of select funct

2020-05-19 01:20:09 -0500 received badge  Supporter (source)