ROS服務和引數的分析

2021-08-08 21:41:02 字數 3046 閱讀 3601

目錄

準備:

ros services

使用rosservice

rosservice list         輸出可用服務的資訊

rosservice call 呼叫帶引數的服務

rosservice type 輸出服務型別

rosservice find 依據型別尋找服務find services by service type

rosservice uri 輸出服務的rosrpc uri

rosservice list

$ rosservice list
/clear

/kill

/reset

/rosout/get_loggers

/rosout/set_logger_level

/spawn

/teleop_turtle/get_loggers

/teleop_turtle/set_logger_level

/turtle1/set_pen

/turtle1/teleport_absolute

/turtle1/teleport_relative

/turtlesim/get_loggers

/turtlesim/set_logger_level

重置(reset)

清除(clear)

再生(spawn)

終止(kill)

rosparam set            設定引數

rosparam get 獲取引數

rosparam load 從檔案讀取引數

rosparam dump 向檔案中寫入引數

rosparam delete 刪除引數

rosparam list 列出引數名

$ rosparam list
/background_b

/background_g

/background_r

/roslaunch/uris/aqy:51932

/run_id

rosparam set [param_name]

rosparam get [param_name]

$ rosparam set background_r 150
$ rosservice call clear

$ rosparam get background_g 

86

$ rosparam get /
background_b: 255

background_g: 86

background_r: 150

roslaunch:

uris:

run_id: e07ea71e-98df-11de-8875-001b21201aa8

rosparam dump and rosparam load
rosparam dump [file_name]

rosparam load [file_name] [namespace]

$ rosparam dump params.yaml
$ rosparam load params.yaml copy

$ rosparam get copy/background_b

255

ROS 服務和引數

2rosservice 24 rosservice find 25 rosservice uri 3rosparam 服務 services 是節點之間通訊的另一種方式。服務允許節點傳送請求 request 並獲得乙個響應 response rosservice可以很輕鬆的使用 ros 客戶端 伺服...

ROS服務和引數

根據小海龜的例子講解ros服務和引數。首先啟動 roscore rosrun turtlesim turtlesim node rosrun turtlesim turtle teleop key 一 ros服務 服務是節點相互通訊的另一種方式。服務允許節點傳送請求並接收響應。二 rosservic...

ROS入門 1 10 理解ROS服務和引數

目錄 ros services 使用rosservice rosservice list rosservice type rosservice call using rosparam rosparam list rosparam set and rosparam get rosparam dump ...