ROS Remote Debgging and Communication (如何远程调试ROS程序)
# Synoposis
- Remote connect to remote PC
- Remote connect to ROS server in docker
- Test using dataset
如何远程调试ROS程序?
# Remote connect to remote PC
## Server Configure
ros_server set to 127.0.0.1 or localhost
```sh
export ROS_IP=[globle_ip]
export ROS_HOSTNAME=ros_server 这里是你真实的主机名 globle_ip
export ROS_MASTER_URI=http://ros_server:11311
```
Test DNS:
```sh
~ ping ros_server
PING ros_server (133.15.23.109) 56(84) bytes of data.
64 bytes from ros_server (133.15.23.109): icmp_seq=1 ttl=64 time=0.055 ms
```
## Client Configure
客户端设置 设置远程主机为ROS MASTER节点:
```sh
export ROS_MASTER_URI=http://ros_server:11311
export ROS_HOSTNAME=local_global_hostname (not be 127.0.0.1 or localhost)
export ROS_IP=135.5.5.26 : globle_ip (not be 127.0.0.1 or localhost)
```
在/etc/hosts 中添加地址解析,并确保能Ping通服务器端:
```sh
ping ros_server
PING ros_server () 56(84) bytes of data. 64 bytes from aisl-pc (): icmp_seq=1 ttl=62 time=1572 ms
```
## Test
- Server:
```sh
roscore
```
- Client
客户端 打开可视化工具:
```sh
rosrun rviz rviz
```
下载数据集(TUM)并播放:
```sh
rosbag play rgbd_dataset_freiburg3_walking_xyz.bag
```
# Possible Errors
```sh
rosrun rviz rviz
```
You may see this error:
![image-20200506105928398](https://cdn.jsdelivr.net/gh/yubaoliu/assets@image/image-20200506105928398.png)
```sh
[ WARN] [1588731959.116219240]: ROS_HOSTNAME / ROS_IP is set to only allow local connections, so a requested connection to 'ros_server' is being rejected.
```
**Solution**:
Set ROS_HOSTNAME / ROS_IP to globle IP rather than Local IP (127.0.0.1 or localhost)
No comments