Ask Your Question
0

Subscribe to lidar node on another machine and run rviz

asked 2015-11-05 03:51:42 -0500

learner88 gravatar image

Hi,

I have 2 machines on the same network. Machine A has master ros uri and has lidar attached. It is the publisher of lidar topic. I wish to run rviz on machine B to view the output of lidar on machine A. I wrote a subscription method on machine B. When i run rviz, rviz subscribes to machine A instead of using the already subscribed node to machine A.

How do I ask rviz to get data from my subscription instead of having rviz subscribes again to lidar topic.

edit retag flag offensive close merge delete

Comments

Can you describe your exact setup, i.e., what nodes on what machine subscribing/publishing which topics - and also what kind of setup you want to achieve. For me, right now, it seems you want to do something that doesn't make sense.

dornhege gravatar image dornhege  ( 2015-11-05 04:18:01 -0500 )edit
1

Does your subscriber on MachineB publish anything? If you are modifying the incoming laser data and then re-publishing it, you could then on rviz, view only the new 're-published' topic.

ParitoshKelkar gravatar image ParitoshKelkar  ( 2015-11-05 12:45:11 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2015-11-06 00:04:03 -0500

Akif gravatar image

If you set

export ROS_MASTER_URI=http://<MACHINE_A_IP>:11311
export ROS_IP=<MACHINE_B_IP>

in your .bashrc file (located in your /home/<username> directory), and run source ~/.bashrc in the terminal, when you run rviz in that terminal, you will subscribe to topics in Machine A's ROS network.

Is this what you ask?

edit flag offensive delete link more

Comments

Hi Akif, i am able to run rviz. but when i run roslaunch hector_slam_launch neato.launch, the GUI appeared has error status saying Fixed Frame [map] does not exist. Do you have any idea why? Thank u.

learner88 gravatar image learner88  ( 2015-11-06 00:23:19 -0500 )edit

map frame should be published by your slam node. Can you run rosrun tf view_frames and post the resulting tf tree here?

Akif gravatar image Akif  ( 2015-11-06 00:31:39 -0500 )edit

here is the tf tree: odom->base_link(Broadcaster: /map_to_odom; Avg rate: 96.613 Hz; Most recent transform: 1446792454.255,-0.007 sec old; Buffer len: 4.948sec) base_link->laser(Broadcaster: /base_frame_laser;Avg rate: 96.785Hz; Most recent transform: 1446792454.256,-0.008 sec old; Buffer len: 4.949

learner88 gravatar image learner88  ( 2015-11-06 00:54:04 -0500 )edit
1

It seems like no one is transforming from map to odom. For now you can change "Global Options->Fixed Frame" option to odom in rviz. After that you can ask a separate question for your setup with hector slam.

Akif gravatar image Akif  ( 2015-11-06 01:01:21 -0500 )edit
0

answered 2015-11-05 20:35:24 -0500

learner88 gravatar image

Thank u dornhege and ParitoshKelkar.

@ParitoshKelkar: My subscriber on machine B does not do publishing. I get u. Thank you for your answer.

@dornhege: Sorry, I am not clear enough. Below is my setup:

Both machines are on the same network.

Machine A: Is the master ros uri. Is connected to a xv lidar and publishes scan data

Machine B: Subscribes to scan data. I wanted to make use of this data to show it on rviz.

However, when i run rviz, instead of showing the subscribed data, rviz subscribes again to xv lidar node on machine A. Paritosh has provided a solution to this which is to publish the subscribed data.

I wish to also ask if it is possible to run rviz on machine B and for rviz to subscribe data direct from machine A's lidar node. It seems possible, but I received an error status saying Fixed Frame [map] does not exist.

Thanks alot.

edit flag offensive delete link more

Comments

1

Generally the Laserscan messages of the /scan topic of a lidar are assigned to the 'laser' frame. Try typing in 'laser' in the 'fixed frame' tab in rviz and see if that lets you visualize the scans.

ParitoshKelkar gravatar image ParitoshKelkar  ( 2015-11-06 01:17:19 -0500 )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: 2015-11-05 03:51:42 -0500

Seen: 597 times

Last updated: Nov 06 '15