rosros 0.2.5
Simple unified interface to ROS1 / ROS2 Python API
|
Patches ROS1 classes with ROS2-compatible members, and vice versa. More...
Functions | |
client_call_wrapper (call) | |
Returns service client call-function wrapped to ensure invoke with request instance. | |
Duration__abs (self) | |
Returns absolute value of this duration. | |
Duration__add (self, other) | |
Returns a new duration, adding given duration to this. | |
Duration__divmod (self, val) | |
Returns the divmod result for this and another duration. | |
Duration__floordiv (self, val) | |
Floor-divides this duration by a number or a duration. | |
Duration__from_msg (cls, msg) | |
Returns a new Duration from given. | |
Duration__init (self, secs=0, nsecs=0, *seconds=0, nanoseconds=0) | |
Constructs a new `Duration`, using either ROS1 or ROS2 arguments. | |
Duration__mod (self, val) | |
Returns the remainder of dividing this duration by another duration. | |
Duration__mul (self, val) | |
Multiplies this duration by an integer or float. | |
Duration__neg (self) | |
Returns negative value of this duration. | |
Duration__sub (self, other) | |
Subtracts a duration from this duration. | |
Duration__truediv (self, val) | |
Divides this duration by an integer or float. | |
patch_ros1 () | |
Patches ROS1 classes with generic compatibility with ROS2 and rosros. | |
patch_ros1_rclify () | |
Patches ROS1 classes with full stand-ins for ROS2 methods and properties. | |
patch_ros2 () | |
Patches ROS2 classes with full stand-ins for ROS1 methods and properties. | |
publish_wrapper (publish) | |
Returns publish-function wrapped to ensure invoke with message instance. | |
Publisher__assert_liveliness (self) | |
Does nothing (ROS2 compatibility stand-in). | |
Publisher__publish (self, *args, **kwds) | |
Publishes message, supports giving message field values as dictionary in args[0]. | |
Rate__remaining (self) | |
Returns time remaining for rate to sleep, as `Duration`. | |
rostimer_sleep_on_event (duration, event=None) | |
Sleeps for the specified duration in ROS time, or until event gets set. | |
Service__init (self, name, service_class, handler, buff_size=65536, error_handler=None) | |
Wraps Service.__init__() to support returning None from server callback. | |
Service__init (self, service_handle, srv_type, srv_name, callback, callback_group, qos_profile) | |
Wraps Service.__init__() to support returning list/dict/None from server callback. | |
Service__spin (self) | |
Spins ROS2 until service or node shutdown. | |
service_serve_wrapper (self, serve) | |
Returns service serve-function wrapped to ensure return with response instance. | |
ServiceProxy__call (self, *args, **kwargs) | |
Calls the service, supports giving request field values as dictionary in args[0]. | |
ServiceProxy__call_async (self, *args, **kwargs) | |
Make a service request and asyncronously get the result. | |
ServiceProxy__remove_pending_request (self, future) | |
Does nothing (ROS2 compatibility stand-in). | |
ServiceProxy__service_is_ready (self) | |
Returns whether service is ready. | |
ServiceProxy__wait_for_service (self, timeout=None, timeout_sec=None) | |
Waits for a service server to become ready. | |
set_extra_attribute (obj, name, value) | |
Sets value for object patched attribute. | |
Subscriber__init (self, name, data_class, callback=None, callback_args=None, queue_size=None, buff_size=65536, tcp_nodelay=False) | |
Wraps rospy.Subscriber.__init__() to add raw bytes autoconversion support. | |
SubscriberImpl__receive_callback (self, msgs, connection) | |
Wraps rospy.topics.SubscriberImpl.receive_callback() with raw bytes autoconversion. | |
Subscription__add_callback (self, cb, cb_args) | |
Registers a callback to be invoked whenever a new message is received. | |
Subscription__callback_args (self) | |
Returns callback args given in constructor. | |
Subscription__init (self, subscription_handle, msg_type, topic, callback, callback_group, qos_profile, raw, event_callbacks) | |
Wraps Subscription.__init__() to support AnyMsg and multiple callbacks. | |
Subscription__invoke_callbacks (self, msg) | |
Handler for received message, invokes all added callbacks. | |
Subscription__remove_callback (self, cb, cb_args) | |
Unregisters a message callback. | |
Temporal__to_msg (self) | |
Returns a new Time or Duration from this. | |
Time__clock_type (self) | |
Returns the ClockType of this Time. | |
Time__del (self) | |
Clear object-related data, if any. | |
Time__from_msg (cls, msg, clock_type=ClockType.ROS_TIME) | |
Returns a new Time from given. | |
Time__init (self, secs=0, nsecs=0, *seconds=0, nanoseconds=0, clock_type=ClockType.SYSTEM_TIME) | |
Constructs a new ROS1 `Time`, using either ROS1 or ROS2 arguments. | |
Time__seconds_nanoseconds (self) | |
Returns time as (seconds, nanoseconds). | |
Timer__cancel (self) | |
Sets timer on pause, until reset or shutdown. | |
Timer__clock (self) | |
Returns the Clock used by this timer. | |
Timer__getName (self) | |
Returns timer name. | |
Timer__ident (self) | |
Returns timer identifier as a non-negative integer. | |
Timer__init (self, callback, callback_group, timer_period_ns, clock, *context=None) | |
Constructs a new ROS2 `Timer`. | |
Timer__init (self, period, callback, oneshot=False, reset=False) | |
Constructs a new ROS1 Timer. | |
Timer__is_alive (self) | |
Returns whether timer is still running. | |
Timer__is_canceled (self) | |
Returns whether the timer has been canceled (paused until reset or shutdown). | |
Timer__is_ready (self) | |
Returns whether timer callback should be called right now. | |
Timer__isDaemon (self) | |
Returns `True`. | |
Timer__join (self) | |
Returns when timer has terminated. | |
Timer__reset (self) | |
Sets last call time to now, postponing next callback by full period; uncancels if canceled. | |
Timer__run (self) | |
Override rospy.Timer.run() to support canceling and resetting, and call timestamps. | |
Timer__setDaemon (self, daemonic) | |
Raises error. | |
Timer__setName (self, name) | |
Sets timer name. | |
Timer__shutdown (self) | |
Stop firing callbacks. | |
Timer__time_since_last_call (self) | |
Returns nanoseconds since last timer callback (ROS2 compatibility stand-in). | |
Timer__time_until_next_call (self) | |
Returns nanoseconds until next timer callback (ROS2 compatibility stand-in). | |
Timer__timer_period_ns (self) | |
Returns timer period in nanoseconds. | |
Timer__timer_period_ns__setter (self, value) | |
Sets timer period in nanoseconds, resets timer if running. | |
TVal__is_nonzero (self) | |
Returns whether value is not zero. | |
TVal__is_zero (self) | |
Returns whether value is zero. | |
TVal__nsecs (self) | |
Returns the nanoseconds portion as `int`. | |
TVal__secs (self) | |
Returns the seconds portion as `int`. | |
TVal__to_nsec (self) | |
Returns value in nanoseconds as `int`. | |
TVal__to_sec (self) | |
Returns value in seconds as `float`. | |
Variables | |
_anymsg | |
_callbacks | |
_clock | |
_invoke_callbacks | |
_name | |
_paused | |
_period | |
_shutdown | |
_time_last | |
_time_next | |
_wakeable | |
call | |
data_class | |
dict | EXTRA_ATTRS = {} |
Extra attributes for objects with __slots__, as {id(obj): {attrname: attrval}}. | |
impl | |
nanoseconds | |
nsecs | |
bool | PATCHED = False |
Whether generic patching has been done during this runtime. | |
bool | PATCHED_FULL = False |
Whether full patching has been done during this runtime. | |
resolved_name | |
ROS1_Duration__init = rospy.Duration.__init__ | |
ROS1_Publisher__publish = rospy.Publisher.publish | |
ROS1_Service__init = rospy.Service.__init__ | |
ROS1_ServiceProxy__call = rospy.ServiceProxy.call | |
ROS1_Subscriber__init = rospy.Subscriber.__init__ | |
ROS1_SubscriberImpl__receive_callback = rospy.topics._SubscriberImpl.receive_callback | |
ROS1_Time__init = rospy.Time.__init__ | |
ROS1_Timer__init = rospy.Timer.__init__ | |
ROS2_Duration__init = rclpy.duration.Duration.__init__ | |
ROS2_Service__init = rclpy.service.Service.__init__ | |
ROS2_Subscription__init = rclpy.subscription.Subscription.__init__ | |
ROS2_Time__init = rclpy.time.Time.__init__ | |
ROS2_Timer__init = rclpy.timer.Timer.__init__ | |
rospy = None | |
secs | |
int | TIMER_COUNTER = 0 |
Patches ROS1 classes with ROS2-compatible members, and vice versa.
rosros.patch.client_call_wrapper | ( | call | ) |
rosros.patch.Duration__abs | ( | self | ) |
rosros.patch.Duration__add | ( | self, | |
other | |||
) |
rosros.patch.Duration__divmod | ( | self, | |
val | |||
) |
rosros.patch.Duration__floordiv | ( | self, | |
val | |||
) |
rosros.patch.Duration__from_msg | ( | cls, | |
msg | |||
) |
rosros.patch.Duration__init | ( | self, | |
secs = 0 , |
|||
nsecs = 0 , |
|||
* | seconds = 0 , |
||
nanoseconds = 0 |
|||
) |
rosros.patch.Duration__mod | ( | self, | |
val | |||
) |
rosros.patch.Duration__mul | ( | self, | |
val | |||
) |
rosros.patch.Duration__neg | ( | self | ) |
rosros.patch.Duration__sub | ( | self, | |
other | |||
) |
rosros.patch.Duration__truediv | ( | self, | |
val | |||
) |
rosros.patch.patch_ros1 | ( | ) |
rosros.patch.patch_ros1_rclify | ( | ) |
rosros.patch.patch_ros2 | ( | ) |
rosros.patch.publish_wrapper | ( | publish | ) |
rosros.patch.Publisher__assert_liveliness | ( | self | ) |
rosros.patch.Publisher__publish | ( | self, | |
* | args, | ||
** | kwds | ||
) |
rosros.patch.Rate__remaining | ( | self | ) |
rosros.patch.rostimer_sleep_on_event | ( | duration, | |
event = None |
|||
) |
Sleeps for the specified duration in ROS time, or until event gets set.
Returns immediately if duration is negative or event is set.
duration | seconds (or rospy.Duration) to sleep |
event | threading.Event to wait() on, if any, will return early if event gets set |
ROSInterruptException | if ROS shutdown occurs before sleep completes |
ROSTimeMovedBackwardsException | if ROS time is set backwards |
rosros.patch.Service__init | ( | self, | |
name, | |||
service_class, | |||
handler, | |||
buff_size = 65536 , |
|||
error_handler = None |
|||
) |
rosros.patch.Service__init | ( | self, | |
service_handle, | |||
srv_type, | |||
srv_name, | |||
callback, | |||
callback_group, | |||
qos_profile | |||
) |
rosros.patch.Service__spin | ( | self | ) |
rosros.patch.service_serve_wrapper | ( | self, | |
serve | |||
) |
rosros.patch.ServiceProxy__call | ( | self, | |
* | args, | ||
** | kwargs | ||
) |
rosros.patch.ServiceProxy__call_async | ( | self, | |
* | args, | ||
** | kwargs | ||
) |
Make a service request and asyncronously get the result.
Service is invoked in a background thread.
This accepts either a request message instance, or positional and keyword arguments to create a new request instance.
rosros.patch.ServiceProxy__remove_pending_request | ( | self, | |
future | |||
) |
rosros.patch.ServiceProxy__service_is_ready | ( | self | ) |
rosros.patch.ServiceProxy__wait_for_service | ( | self, | |
timeout = None , |
|||
timeout_sec = None |
|||
) |
Waits for a service server to become ready.
Returns as soon as a server becomes ready or if the timeout expires.
Gives rospy.ServiceProxy.wait_for_service the behavior of rclpy.client.Client.wait_for_service.
timeout | time to wait, as seconds or ROS Duration. If None, then wait forever. |
timeout_sec | seconds to wait; if None, wait forever (ROS2 compatibility stand-in) |
rosros.patch.set_extra_attribute | ( | obj, | |
name, | |||
value | |||
) |
rosros.patch.Subscriber__init | ( | self, | |
name, | |||
data_class, | |||
callback = None , |
|||
callback_args = None , |
|||
queue_size = None , |
|||
buff_size = 65536 , |
|||
tcp_nodelay = False |
|||
) |
rosros.patch.SubscriberImpl__receive_callback | ( | self, | |
msgs, | |||
connection | |||
) |
rosros.patch.Subscription__add_callback | ( | self, | |
cb, | |||
cb_args | |||
) |
Registers a callback to be invoked whenever a new message is received.
cb | callback function to invoke with message data instance, i.e. fn(data). If callback args is set, they will be passed in as the second argument. |
cb_cargs | additional arguments to pass to callback |
rosros.patch.Subscription__callback_args | ( | self | ) |
rosros.patch.Subscription__init | ( | self, | |
subscription_handle, | |||
msg_type, | |||
topic, | |||
callback, | |||
callback_group, | |||
qos_profile, | |||
raw, | |||
event_callbacks | |||
) |
rosros.patch.Subscription__invoke_callbacks | ( | self, | |
msg | |||
) |
rosros.patch.Subscription__remove_callback | ( | self, | |
cb, | |||
cb_args | |||
) |
rosros.patch.Temporal__to_msg | ( | self | ) |
rosros.patch.Time__clock_type | ( | self | ) |
rosros.patch.Time__del | ( | self | ) |
rosros.patch.Time__from_msg | ( | cls, | |
msg, | |||
clock_type = ClockType.ROS_TIME |
|||
) |
rosros.patch.Time__init | ( | self, | |
secs = 0 , |
|||
nsecs = 0 , |
|||
* | seconds = 0 , |
||
nanoseconds = 0 , |
|||
clock_type = ClockType.SYSTEM_TIME |
|||
) |
rosros.patch.Time__seconds_nanoseconds | ( | self | ) |
rosros.patch.Timer__cancel | ( | self | ) |
rosros.patch.Timer__clock | ( | self | ) |
rosros.patch.Timer__ident | ( | self | ) |
rosros.patch.Timer__init | ( | self, | |
callback, | |||
callback_group, | |||
timer_period_ns, | |||
clock, | |||
* | context = None |
||
) |
rosros.patch.Timer__init | ( | self, | |
period, | |||
callback, | |||
oneshot = False , |
|||
reset = False |
|||
) |
Constructs a new ROS1 Timer.
Plugs in ROS2 API compatibility: cancelling, resetting, and public timing info.
period | desired period between callbacks, as rospy.Duration |
callback | callback to be called, taking rospy.TimerEvent |
oneshot | if True, fire only once, otherwise fire continuously until shutdown is called [default: False] |
reset | if True, timer is reset when rostime moved backward. [default: False] |
rosros.patch.Timer__is_alive | ( | self | ) |
rosros.patch.Timer__is_canceled | ( | self | ) |
rosros.patch.Timer__is_ready | ( | self | ) |
rosros.patch.Timer__join | ( | self | ) |
rosros.patch.Timer__reset | ( | self | ) |
rosros.patch.Timer__run | ( | self | ) |
rosros.patch.Timer__setDaemon | ( | self, | |
daemonic | |||
) |
rosros.patch.Timer__setName | ( | self, | |
name | |||
) |
rosros.patch.Timer__shutdown | ( | self | ) |
rosros.patch.Timer__time_since_last_call | ( | self | ) |
rosros.patch.Timer__time_until_next_call | ( | self | ) |
rosros.patch.Timer__timer_period_ns | ( | self | ) |
rosros.patch.Timer__timer_period_ns__setter | ( | self, | |
value | |||
) |
rosros.patch.TVal__is_nonzero | ( | self | ) |
rosros.patch.TVal__is_zero | ( | self | ) |
rosros.patch.TVal__nsecs | ( | self | ) |
rosros.patch.TVal__secs | ( | self | ) |
rosros.patch.TVal__to_nsec | ( | self | ) |
rosros.patch.TVal__to_sec | ( | self | ) |
dict rosros.patch.EXTRA_ATTRS = {} |
bool rosros.patch.PATCHED = False |
bool rosros.patch.PATCHED_FULL = False |
rosros.patch.ROS1_Publisher__publish = rospy.Publisher.publish |
rosros.patch.ROS1_ServiceProxy__call = rospy.ServiceProxy.call |
rosros.patch.ROS1_Subscriber__init = rospy.Subscriber.__init__ |
rosros.patch.ROS1_SubscriberImpl__receive_callback = rospy.topics._SubscriberImpl.receive_callback |
rosros.patch.ROS2_Duration__init = rclpy.duration.Duration.__init__ |
rosros.patch.ROS2_Service__init = rclpy.service.Service.__init__ |
rosros.patch.ROS2_Subscription__init = rclpy.subscription.Subscription.__init__ |