I can't use rviz in host PC
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").
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.
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 ...
Do you set 'ROS_IP' in both computers?
Yes,I have already set "ROS_IP" on each PC.
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...
I have not resolved it yet. Thank you for your advice, I will try it.
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.