Kết nối ROS hai máy tính
Last updated
Was this helpful?
Last updated
Was this helpful?
Gỉa sử có 2 máy tính:
Máy 1: ground station tên là nguyen3620
ip là 134.59.129.159,
Máy 2: odroid
ip là 134.59.129.151
kiểm tra thiết lập tên và ip address: more /etc/hosts
edit với: sudo /etc/hosts, cần thiết lập cho may ground station và máy odroid
127.0.0.1 localhost
134.59.129.159 nguyen3620
134.59.133.151 odroid
.....
mở 1 terminal mới, trên máy ground station, đặt
export ROS_MASTER_URI=
mở 1 terminal mới, trên máy odroid, đặt
export ROS_MASTER_URI=
check với lệnh
echo $ROS_MASTER_URI
Một số thông tin khác có thể cần check lại
echo $ROS_IP
echo $ROS_HOST_NAME
Từ máy ground station, mở 1 terminal, type
ssh odroid@134.59.129.151 -Y
(Hoặc ssh odroid@134.59.129.151 -X , for untrusted client??)
Nếu có warning:
Publish IMU state
Imu data, orientation computed by FCU
Raw IMU data without orientation
FCU compass data
Temperature reported by FCU (usually from barometer)
Air pressure.
rostopic echo /mavros/imu/data_raw
hoặc
rostopic echo /mavros/imu/data
Có kiểu sensor_msgs/Imu.msg
Trong đó angular_velocity có kiểu geometry_msgs/Vector3
Và Vector3 có 3 thành phần x, y, z
Có thể tra cứu thông tin trực tiếp trên ROS, dùng rosmsg show sensor_msgs/Imu
Do đó, ví dụ, muốn hiển thị thành phần x của angularvelocity trên rqt_graph , cần chọn
/mavros/imu/data/angular_velocity/x
Giả sử cần lưu dữ liệu trong home/android vào 1 file có tên imu14sept2017.txt
rostopic echo /mavros/imu/data >imu14sept2017.txt
rosrun rqt_graph rqt_graph
rồi ví dụ chọn trên cửa sổ bên trên góc trái /mavros/imu/data/angular_velocity/x
Syntax:
To copy a file from B
to A
while logged into B
:
To copy a file from B
to A
while logged into A
:
Vi du
scp imu_data.txt nguyen@134.59.129.159:/home/nguyen
scp -r odroid@odroid:/home/odroid/catkin_ws/src/i3s_img_proc /home/lhnguyen/catkin_ws/src
ou can use secure copy (scp) with the recursive option (-r
):
Alternatively, I recommend rsync because you can resume transfers if the connection breaks, and it intelligently transfers only the differences between files:
Note that in both cases you should be careful of trailing slashes: moving/path/to/local/dir
toremotehost:/path/to/remote/dir/
results in/path/to/remote/dir/dir
~imu/data ( )
~imu/data_raw ( )
~imu/mag ( )
~imu/temperature ()
~imu/atm_pressure ()