Class: ROS::ParameterManager
- Inherits:
-
Object
- Object
- ROS::ParameterManager
- Defined in:
- lib/ros/parameter_manager.rb
Overview
ROS parameter sever inteface. API document is here ros.org/wiki/ROS/Parameter%20Server%20API
Instance Method Summary (collapse)
-
- (Boolean) delete_param(key)
delete parameter 'key'.
-
- (String) get_param(key)
get parameter named 'key'.
-
- (Array) get_param_names
get the all keys of parameters.
-
- (String, ...) has_param(key)
check if the master has the key.
-
- (ParameterManager) initialize(master_uri, caller_id, remappings)
constructor
A new instance of ParameterManager.
-
- (Array) search_param(key)
search the all namespace for key.
-
- (Boolean) set_param(key, value)
set parameter for 'key'.
Constructor Details
- (ParameterManager) initialize(master_uri, caller_id, remappings)
Returns a new instance of ParameterManager
23 24 25 26 27 28 |
# File 'lib/ros/parameter_manager.rb', line 23 def initialize(master_uri, caller_id, remappings) @caller_id = caller_id @master_uri = master_uri @remappings = remappings @server = XMLRPC::Client.new2(@master_uri) end |
Instance Method Details
- (Boolean) delete_param(key)
delete parameter 'key'
69 70 71 72 73 74 75 76 77 |
# File 'lib/ros/parameter_manager.rb', line 69 def delete_param(key) code, , value = @server.call("deleteParam", @caller_id, key) case code when 1 return true else return false end end |
- (String) get_param(key)
get parameter named 'key'
34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/ros/parameter_manager.rb', line 34 def get_param(key) if @remappings[key] return @remappings[key] end code, , value = @server.call("getParam", @caller_id, key) case code when 1 return value else return nil end end |
- (Array) get_param_names
get the all keys of parameters
115 116 117 118 119 120 121 122 123 124 125 |
# File 'lib/ros/parameter_manager.rb', line 115 def get_param_names code, , value = @server.call("getParamNames", @caller_id) case code when 1 return value when -1 raise else return false end end |
- (String, ...) has_param(key)
check if the master has the key
99 100 101 102 103 104 105 106 107 108 109 |
# File 'lib/ros/parameter_manager.rb', line 99 def has_param(key) code, , value = @server.call("hasParam", @caller_id, key) case code when 1 return value when -1 raise else return false end end |
- (Array) search_param(key)
search the all namespace for key
83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/ros/parameter_manager.rb', line 83 def search_param(key) code, , value = @server.call("searchParam", @caller_id, key) case code when 1 return value when -1 raise else return false end end |
- (Boolean) set_param(key, value)
set parameter for 'key'
53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/ros/parameter_manager.rb', line 53 def set_param(key, value) code, , value = @server.call("setParam", @caller_id, key, value) case code when 1 return true when -1 raise else return false end end |