Class: ROS::SlaveProxy
- Inherits:
-
Object
- Object
- ROS::SlaveProxy
- Defined in:
- lib/ros/slave_proxy.rb
Overview
you can access to ROS Slave nodes.
Instance Attribute Summary (collapse)
-
- (String) caller_id
Caller_id of this caller.
-
- (String) slave_uri
URI of target.
Instance Method Summary (collapse)
-
- (Array) get_bus_info
Bus information.
-
- (Array) get_bus_stats
Stats.
-
- (String) get_master_uri
URI of master.
-
- (Integer) get_pid
Pid of the slave process.
-
- (Array) get_publications
Publications.
-
- (Array) get_subscriptions
Topiccs.
-
- (SlaveProxy) initialize(caller_id, slave_uri)
constructor
A new instance of SlaveProxy.
-
- (Boolean) param_update(param_key, param_value)
True.
-
- (Boolean) publisher_update(topic, publishers)
True.
- - (Object) request_topic(topic, protocols)
- - (Object) shutdown(msg = '')
Constructor Details
- (SlaveProxy) initialize(caller_id, slave_uri)
Returns a new instance of SlaveProxy
23 24 25 26 27 |
# File 'lib/ros/slave_proxy.rb', line 23 def initialize(caller_id, slave_uri) @caller_id = caller_id @slave_uri = slave_uri @proxy = XMLRPC::Client.new2(@slave_uri).proxy end |
Instance Attribute Details
- (String) caller_id
Returns caller_id of this caller
151 152 153 |
# File 'lib/ros/slave_proxy.rb', line 151 def caller_id @caller_id end |
- (String) slave_uri
Returns URI of target
148 149 150 |
# File 'lib/ros/slave_proxy.rb', line 148 def slave_uri @slave_uri end |
Instance Method Details
- (Array) get_bus_info
Returns bus information
42 43 44 45 46 47 48 49 |
# File 'lib/ros/slave_proxy.rb', line 42 def get_bus_info code, , info = @proxy.getBusInfo(@caller_id) if code == 1 return info else raise end end |
- (Array) get_bus_stats
Returns stats
31 32 33 34 35 36 37 38 |
# File 'lib/ros/slave_proxy.rb', line 31 def get_bus_stats code, , stats = @proxy.getBusStats(@caller_id) if code == 1 return stats else raise end end |
- (String) get_master_uri
Returns URI of master
53 54 55 56 57 58 59 60 |
# File 'lib/ros/slave_proxy.rb', line 53 def get_master_uri code, , uri = @proxy.getMasterUri(@caller_id) if code == 1 return uri else raise end end |
- (Integer) get_pid
Returns pid of the slave process
77 78 79 80 81 82 83 84 |
# File 'lib/ros/slave_proxy.rb', line 77 def get_pid code, , pid = @proxy.getPid(@caller_id) if code == 1 return pid else raise end end |
- (Array) get_publications
Returns publications
99 100 101 102 103 104 105 106 |
# File 'lib/ros/slave_proxy.rb', line 99 def get_publications code, , topic = @proxy.getPublications(@caller_id) if code == 1 return topic else raise end end |
- (Array) get_subscriptions
Returns topiccs
88 89 90 91 92 93 94 95 |
# File 'lib/ros/slave_proxy.rb', line 88 def get_subscriptions code, , topic = @proxy.getSubscriptions(@caller_id) if code == 1 return topic else raise end end |
- (Boolean) param_update(param_key, param_value)
Returns true
112 113 114 115 116 117 118 119 |
# File 'lib/ros/slave_proxy.rb', line 112 def param_update(param_key, param_value) code, , val = @proxy.paramUpdate(@caller_id, param_key, param_value) if code == 1 return true else raise end end |
- (Boolean) publisher_update(topic, publishers)
Returns true
125 126 127 128 129 130 131 132 |
# File 'lib/ros/slave_proxy.rb', line 125 def publisher_update(topic, publishers) code, , val = @proxy.publisherUpdate(@caller_id, topic, publishers) if code == 1 return true else raise end end |
- (Object) request_topic(topic, protocols)
136 137 138 139 140 141 142 143 144 145 |
# File 'lib/ros/slave_proxy.rb', line 136 def request_topic(topic, protocols) code, , protocol = @proxy.requestTopic(@caller_id, topic, protocols) if code == 1 return protocol else raise end end |
- (Object) shutdown(msg = '')
64 65 66 67 68 69 70 71 72 73 |
# File 'lib/ros/slave_proxy.rb', line 64 def shutdown(msg='') code, , val = @proxy.shutdown(@caller_id, msg) if code == 1 return true elsif code == 0 return false else raise end end |