rosros 0.2.5
Simple unified interface to ROS1 / ROS2 Python API
Loading...
Searching...
No Matches
core.py File Reference

Go to the source code of this file.

Namespaces

namespace  rosros
 Simple unified interface to ROS1 / ROS2.
 
namespace  rosros.core
 ROS system and node functionality.
 

Functions

 rosros.core.create_client (service, cls_or_typename, **qosargs)
 Returns a ROS service client instance, for invoking a service.
 
 rosros.core.create_publisher (topic, cls_or_typename, latch=False, queue_size=0, **qosargs)
 Returns a ROS publisher instance.
 
 rosros.core.create_rate (frequency)
 Returns a ROS rate instance, for sleeping at a fixed rate.
 
 rosros.core.create_service (service, cls_or_typename, callback, **qosargs)
 Returns a ROS service server instance, for providing a service.
 
 rosros.core.create_subscriber (topic, cls_or_typename, callback, callback_args=None, queue_size=0, raw=False, **qosargs)
 Returns a ROS subscriber instance.
 
 rosros.core.create_timer (period, callback, oneshot=False, immediate=False)
 Returns a ROS timer instance.
 
 rosros.core.delete_param (name)
 Deletes parameter from the node.
 
 rosros.core.destroy_entity (item)
 Closes the given publisher, subscriber, service client, or service server instance.
 
 rosros.core.get_logger ()
 Returns `logging.Logger` for logging to ROS log handler.
 
 rosros.core.get_namespace ()
 Returns ROS node namespace.
 
 rosros.core.get_node_name ()
 Returns ROS node full name with namespace.
 
 rosros.core.get_nodes ()
 Returns all ROS nodes, as `[node full name, ]`.
 
 rosros.core.get_param (name, default=None, autoset=True)
 Returns parameter value from the node.
 
 rosros.core.get_param_names ()
 Returns the names of all parameters on the node.
 
 rosros.core.get_params (nested=True)
 Returns the current ROS node parameters, by default as nested dictionary.
 
 rosros.core.get_ros_version ()
 Returns ROS version information, as {"major": "1" / "2", ?"minor": distro like "noetic"}.
 
 rosros.core.get_rostime ()
 Returns ROS time instance for current ROS clock time.
 
 rosros.core.get_services (node=None, namespace=None, include_types=True)
 Returns all available ROS services, as `[(service name, [type name, ]), ]`.
 
 rosros.core.get_topics ()
 Returns all available ROS topics, as `[(topic name, [type name, ]), ]`.
 
 rosros.core.has_param (name)
 Returns whether the parameter exists on the node.
 
 rosros.core.init_node (name, args=None, namespace=None, anonymous=False, log_level=None, enable_rosout=True, multithreaded=True, reentrant=False)
 Initializes ROS and creates ROS node.
 
 rosros.core.init_params (defaults=None, **defaultkws)
 Sets all parameters on node from defaults dictionary.
 
 rosros.core.ok ()
 Returns whether ROS has been initialized and is not shut down.
 
 rosros.core.on_shutdown (callback, *args, **kwargs)
 Registers function to be called on shutdown, after node has been torn down.
 
 rosros.core.register_init (node=None)
 Informs `rosros` of ROS having been initialized outside of `init_node()`.
 
 rosros.core.remap_name (name, namespace=None)
 Returns the absolute remapped topic/service name if mapping exists.
 
 rosros.core.resolve_name (name, namespace=None)
 Returns absolute remapped name, namespaced under current node if relative or private.
 
 rosros.core.set_param (name, value, descriptor=None)
 Sets a parameter on the node.
 
 rosros.core.shutdown (reason=None)
 Shuts down live ROS node, if any.
 
 rosros.core.sleep (duration)
 Sleeps for the specified duration in ROS time.
 
 rosros.core.spin ()
 Spins ROS node forever.
 
 rosros.core.spin_once (timeout=None)
 Waits until timeout in ROS1; executes one ROS operation or waits until timeout in ROS2.
 
 rosros.core.spin_until_future_complete (future, timeout=None)
 Spins ROS until future complete or timeout reached or ROS shut down.
 
 rosros.core.start_spin ()
 Sets ROS node spinning forever in a background thread.
 
 rosros.core.wait_for_publisher (topic, timeout=None, cls_or_typename=None)
 Blocks until topic has at least one publisher.
 
 rosros.core.wait_for_service (service, timeout=None, cls_or_typename=None)
 Blocks until service is available.
 
 rosros.core.wait_for_subscriber (topic, timeout=None, cls_or_typename=None)
 Blocks until topic has at least one subscriber.
 

Variables

 rosros.core.AnyMsg = ros.AnyMsg
 rospy.AnyMsg in ROS1, equivalent stand-in in ROS2
 
 rosros.core.Bag = ros.Bag
 rosbag.Bag in ROS1 (with some additional functionality), equivalent class in ROS2
 
 rosros.core.ros = ros1 or ros2
 
 rosros.core.ros1 = None