rosros 0.2.5
Simple unified interface to ROS1 / ROS2 Python API
|
Stand-ins for `rospy.client` in ROS2. More...
Classes | |
class | _unspecified |
Functions | |
delete_param (param_name) | |
Deletes a parameter on the node. | |
get_master (env=None) | |
Returns a partial stand-in of `rospy.MasterProxy`. | |
get_param (param_name, default=_unspecified) | |
Returns a parameter value from the node. | |
get_param_names () | |
Returns a list of node parameter names, with absolute namespace. | |
get_published_topics (namespace="/") | |
Returns a list of published topics. | |
has_param (param_name) | |
Test if parameter exists on the node. | |
init_node (name, argv=None, anonymous=False, log_level=None, disable_rostime=None, disable_rosout=False, disable_signals=None, xmlrpc_port=None, tcpros_port=None) | |
Inits ROS2 and creates ROS2 node. | |
myargv (argv=None) | |
Returns command-line arguments with remappings removed. | |
on_shutdown (h) | |
Registers function to be called on shutdown, after node has been torn down. | |
search_param (param_name) | |
Search for a parameter on the node. | |
set_param (param_name, param_value) | |
Set a parameter on the node. | |
spin () | |
Spins ROS2 node forever. | |
wait_for_message (topic, topic_type, timeout=None) | |
Receive one message from topic. | |
Variables | |
dict | _ROSPY_LOG_LEVEL_TO_PY_LEVEL |
Map rospy log level constants to Python logging level constants. | |
int | DEBUG = 1 |
int | ERROR = 8 |
int | FATAL = 16 |
get_param_cached = get_param | |
Stand-in for `rospy.get_param_cached`. | |
int | INFO = 2 |
int | WARN = 4 |
Stand-ins for `rospy.client` in ROS2.
rosros.rospify.client.delete_param | ( | param_name | ) |
rosros.rospify.client.get_master | ( | env = None | ) |
rosros.rospify.client.get_param | ( | param_name, | |
default = _unspecified |
|||
) |
rosros.rospify.client.get_param_names | ( | ) |
rosros.rospify.client.get_published_topics | ( | namespace = "/" | ) |
rosros.rospify.client.has_param | ( | param_name | ) |
rosros.rospify.client.init_node | ( | name, | |
argv = None , |
|||
anonymous = False , |
|||
log_level = None , |
|||
disable_rostime = None , |
|||
disable_rosout = False , |
|||
disable_signals = None , |
|||
xmlrpc_port = None , |
|||
tcpros_port = None |
|||
) |
Inits ROS2 and creates ROS2 node.
name | node name, with no namespace |
argv | list of command-line arguments for the node |
anonymous | whether to auto-generate a unique name for the node, using the given name as base |
log_level | log level to set for the node logger, one of `rospify.DEBUG .INFO .WARN .ERROR .FATAL` |
disable_rostime | ignored (ROS1 compatibility stand-in) |
disable_rosout | whether to suppress auto-publication of rosout |
disable_signals | ignored (ROS1 compatibility stand-in) |
xmlrpc_port | ignored (ROS1 compatibility stand-in) |
tcpros_port | ignored (ROS1 compatibility stand-in) |
rosros.rospify.client.myargv | ( | argv = None | ) |
rosros.rospify.client.on_shutdown | ( | h | ) |
rosros.rospify.client.search_param | ( | param_name | ) |
rosros.rospify.client.set_param | ( | param_name, | |
param_value | |||
) |
Set a parameter on the node.
If param_value is a dictionary, it will be treated as a parameter tree, where param_name is the namespace. For example:::
will set param_name.x=1, param_name.y=2, and param_name.sub.z=3. Furthermore, it will replace all existing parameters in the param_name namespace with the parameters in param_value. You must set parameters individually if you wish to perform a union update.
param_name | parameter name |
param_value | parameter value |
rosros.rospify.client.wait_for_message | ( | topic, | |
topic_type, | |||
timeout = None |
|||
) |
Receive one message from topic.
This will create a new subscription to the topic, receive one message, then unsubscribe.
topic | name of topic |
topic_type | topic type class |
timeout | timeout time in seconds or ROS Duration |
ROSException | if specified timeout is exceeded |
ROSInterruptException | if shutdown interrupts wait |
|
protected |
rosros.rospify.client.get_param_cached = get_param |