rostopic pub 命令發佈自定義消息類型

自定義消息類型:hdw_driver/update_file_msg

string motor_board_file_name
string power_board_file_name
string sensor_board_file_name
string imu_board_file_name
bool update_motor_board
bool update_power_board
bool update_sensor_board
bool update_imu_board

想給該消息類型數據提供值爲:

motor_board_file_name: A
power_board_file_name: B
sensor_board_file_name: C
imu_board_file_name: D
update_motor_board: True
update_power_board: True
update_sensor_board: True
update_imu_board: True

則在終端執行

rostopic pub -1 /hdw_update hdw_driver/update_file_msg  A B C D 1 1 1 1

語法:pub <topic-name> <topic-type> [data...]
給每一個消息元素賦值,中間用“空格”隔開,0爲false 非0爲true

查看該消息類型的topic數據:rostopic echo /hdw_update:

motor_board_file_name: A
power_board_file_name: B
sensor_board_file_name: C
imu_board_file_name: D
update_motor_board: True
update_power_board: True
update_sensor_board: True
update_imu_board: True
---
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章