自定義消息類型: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
---