ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org
Ask Your Question
0

Send data from robot to PC for Visualization

asked 2022-09-14 08:10:13 -0600

Kostas Tzias gravatar image

updated 2022-09-14 09:08:31 -0600

ravijoshi gravatar image

I have created a mobile robot that maps the environment.

My problem is that I don't know how to see what my robot provides (map) when I unplug it from my PC.

I am using a raspberry pi (having ROS Noetic on Ubuntu Mate) in which I loaded all the files for automated obstacle avoidance.

How can I send the data from the robot to my PC so I can use gmapping and RViz to visualize the map remotely (no cables)?

edit retag flag offensive close merge delete

Comments

  1. Write a publisher who can send the data from the robot.
  2. Write a subscriber on your PC which can receive the transmitted data.
  3. Use RViz to visualize it.

If you are unsure about implementing the above points, please feel free to look at ROS Tutorials.

ravijoshi gravatar image ravijoshi  ( 2022-09-14 09:06:11 -0600 )edit

That sounds really simple , but what happens when both robot and pc running on different ROS masters .

Kostas Tzias gravatar image Kostas Tzias  ( 2022-09-16 07:45:46 -0600 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2022-09-14 19:48:27 -0600

tomarRobin gravatar image

updated 2022-09-14 19:55:43 -0600

Hey there, Try to follow the following steps :

  1. First thing you’ll need is a wireless connection between your robot and your pc. You can connect both to the same wifi network and that should do it. Also both of them should have a static ip address.
  2. You’ll need to write these lines in your robot’s ~/.bashrc file. These lines will expose your ros master to the network and you can access this ros masters data from some other machine on the network.(robot ip should be replaced with actual robot ip and pc_ip with actual pc ip)

export ROS_MASTER_URI=http://robot_ip:11311 export ROS_IP=robot_ip export ROS_HOSTNAME=robot_ip Then you’ll need to write these lines in your pc’s ~/.bashrc file export ROS_MASTER_URI=http://robot_ip:11311 export ROS_IP=pc_ip export ROS_HOSTNAME=pc_ip

Now you source your ~/.bashrc in robot and start your code from that terminal.Source ~/.bashrc from your pc and try rostopic echo. If everything is done correctly you should be able to see all the topics. And now you can use them how ever you want.

edit flag offensive delete link more

Comments

So this works . I do see the topics and nodes that are published from my robot but when i open rviz there are no published data from /scan topic (while i can see it with rostopic list ).

Kostas Tzias gravatar image Kostas Tzias  ( 2022-09-16 07:48:52 -0600 )edit
1

but when i open rviz there are no published data from /scan topic

@Kostas Tziab: Some people have reported configuring the /etc/hosts file helped in this condition. However, please note that the /etc/hosts file should be configured on both computers.

ravijoshi gravatar image ravijoshi  ( 2022-09-16 11:12:17 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2022-09-14 08:10:13 -0600

Seen: 43 times

Last updated: Sep 14 '22