Ask Your Question
0

I can't use rviz in host PC

asked 2018-01-30 06:29:05 -0500

sasadasd gravatar image

updated 2018-01-31 08:18:47 -0500

gvdhoorn gravatar image

My purpose is executing navigation to my handmade robot. I have 2 PCs. I'd like to see the rviz and set the goal position from host PC remotely. And I 'd like to control remote PC on the robot to execute amcl.launch.

I have already executed amcl.launch remotely on the remote PC, but I couldn't see the map of rviz from host PC. I thought that it looks like rviz didn't get the information of remote PC. Therefore,I executed "rqt_graph"on my host PC, then I could see some nodes. From this result , I found that my host PC and remote PC are capable of communicating each other.

Please let me know how to see the rviz from my host PC?


Edit: I configured commands as the following procedure.

[1] setting of IP Address and name

on Host(NotePC)
I executed "sudo gedit /etc/hosts" and save the following parameter
    192.168.122.22 NotePC
    192.168.122.33 mori

on remote PC(mori)
I executed same command.
    192.168.122.22 NotePC
    192.168.122.33 mori

[2] start roscore I executed the following command to start roscore in host(NotePC)

export ROS_HOSTNAME=Notepc 
export ROS_MASTER_URI=http://192.168.122.22:11311 
export ROS_IP=192.168.122.22 
roscore

[3] connect to remotePC

ssh mori@mori -p 22
export ROS_HOSTNAME=mori
export ROS_MASTER_URI=http://192.168.122.22:11311 
export ROS_IP=192.168.122.33 
sudo chmod 666 /dev/ttyUSB0
roslaunch  myrobo_navigation amcl.launch

[4] rqt_graph

export ROS_HOSTNAME=Notepc 
export ROS_MASTER_URI=http://192.168.122.22:11311 
export ROS_IP=192.168.122.22 
rqt_graph

Then, The diagram is appeared the following. And I can't see the tf(I also checked it by executing "rosrun tf view_frames").

image description

If I execute roscore and the step [3] only on the remote PC . I can get the following diagram. And I can see tf tree and rviz.

image description

My launch file "amcl.launch" is the following:

<launch>
  <machine name="mori" address="mori" env-loader="/home/mori/catkin_ws/devel/env.sh" user="mori" password="ubuntu"/>
  <arg name="launch_rviz" default="true"/>
  <arg name="with_camera" default="true"/>

  <!-- RPLider.launch -->
  <node machine="mori" name="rplidarNode" pkg="rplidar_ros"  type="rplidarNode" output="screen">
      <param name="serial_port"         type="string" value="/dev/ttyUSB0"/>  
      <param name="serial_baudrate"     type="int"    value="115200"/>
      <param name="frame_id"            type="string" value="laser"/>
      <param name="inverted"            type="bool"   value="false"/>
      <param name="angle_compensate"    type="bool"   value="true"/>
  </node>

  <!-- odometry_tf -->
  <node machine="mori" pkg="odometry_tf" type="odometry_tf_node" name="odometry_tf_node"/>

  <!-- Map server -->
  <arg name="map_file" default="$(find myrobo_navigation)/map/map.yaml"/>
  <node machine="mori" name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />

  <!-- AMCL -->
  <include file="$(find myrobo_navigation)/launch/include/laser_amcl.launch.xml"/>

  <!-- Move base -->
  <include file="$(find myrobo_navigation)/launch/include/move_base.launch.xml"/>

  <node machine="mori" if="$(arg with_camera)" name="image_transport" pkg="image_transport" type="republish" args="compressed in:=/raspicam_node/image raw out:=/camera/image_raw"/>

   <!-- usb_cam -->
  <node machine="mori" name="usb_cam" pkg="usb_cam" type="usb_cam_node" >
    <param name="video_device" value="/dev/video1" />
    <param name="pixel_format ...
(more)
edit retag flag offensive close merge delete

Comments

Do you set 'ROS_IP' in both computers?

rdelgadov gravatar image rdelgadov  ( 2018-01-30 11:38:45 -0500 )edit

Yes,I have already set "ROS_IP" on each PC.

sasadasd gravatar image sasadasd  ( 2018-01-31 07:56:40 -0500 )edit

Do you solve your problem? I'm facing similar problem with hector slam, between a RasPi an a laptop. But, in my case, changing the network, sometimes, it works. ie using an external router as AP, instead of using PI as AP and laptop connected to PI...

elgarbe gravatar image elgarbe  ( 2018-02-10 12:24:28 -0500 )edit

I have not resolved it yet. Thank you for your advice, I will try it.

sasadasd gravatar image sasadasd  ( 2018-02-16 18:31:10 -0500 )edit

I found my problem!!! It was time issue. When I test with my home router, both PC and PI connect to it and get their clock sinchroniced from internet. But, when I goes to the river, where the router don't has internet connection, then PI has different time than PC and don't work.

elgarbe gravatar image elgarbe  ( 2018-02-16 20:46:12 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
2

answered 2018-01-31 01:14:50 -0500

tfoote gravatar image

Please see the Network debugging guide: http://wiki.ros.org/ROS/NetworkSetup

For basic instrucitons see http://wiki.ros.org/ROS/Tutorials/Mul...

edit flag offensive delete link more

Comments

Thank you for your reply. But I think that it is not problem of the network. when I executed amcl.launch on remote PC, The published topics are less than when executing it only on remote PC. So, does it have problems on my launch file ?

sasadasd gravatar image sasadasd  ( 2018-01-31 16:03:33 -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

2 followers

Stats

Asked: 2018-01-30 06:29:05 -0500

Seen: 1,033 times

Last updated: Feb 10 '18