rosbridge_library.capability module
- class rosbridge_library.capability.Capability(protocol)
Bases:
object
Handles the operation-specific logic of a rosbridge message.
May define one or more opcodes to handle, for example ‘publish’ or ‘call_service’
Each connected client receives its own capability instance, which are managed by the client’s own protocol instance.
Protocol.send() is available to send messages back to the client.
- basic_type_check(msg, types_info)
Perform basic typechecking on fields in msg.
- Parameters:
msg – A message, deserialized into a dictionary
types_info –
A list of tuples (mandatory, fieldname, fieldtype) where
mandatory - boolean, is the field mandatory
fieldname - the name of the field in the message
fieldtypes - the expected python type of the field or list of types
- Raises:
MissingArgumentException – If a field is mandatory but not present in the message
InvalidArgumentException – If a field is present but not of the type specified by fieldtype
- finish()
Notify this capability that the client is finished.
Tells the capability that it’s time to free up resources.
- handle_message(message)
Handle an incoming message.
Called by the protocol after having already checked the message op code.
- Parameters:
message – The incoming message, deserialized into a dictionary