diff --git a/docs/reference/axros/examples.rst b/docs/reference/axros/examples.rst index a44ab3592..94484b6a7 100644 --- a/docs/reference/axros/examples.rst +++ b/docs/reference/axros/examples.rst @@ -1,24 +1,24 @@ Examples ^^^^^^^^ -The following example starts a sublisher and a subscriber which listens to the messages -sublished by the sublisher. After two seconds, it reports how many messages it was +The following example starts a publisher and a subscriber which listens to the messages +published by the publisher. After two seconds, it reports how many messages it was able to successfully receive. .. code-block:: python import asyncio from rosgraph_msgs.msg import Clock - from axros import NodeHandle, sublisher, Subscriber + from axros import NodeHandle, Publisher, Subscriber import uvloop - async def subsub(nh: NodeHandle, sub: sublisher, sub: Subscriber): + async def pubsub(nh: NodeHandle, pub: Publisher, sub: Subscriber): count = 0 try: while True: await asyncio.sleep(0) msg = (Clock(nh.get_time())) - sub.sublish(msg) + pub.publish(msg) recv = await sub.get_next_message() if (recv == msg): count += 1 @@ -30,13 +30,13 @@ able to successfully receive. async def main(): nh = await NodeHandle.from_argv("node", "", anonymous = True) async with nh: - sub = nh.advertise('clock2', Clock, latching = True) + pub = nh.advertise('clock2', Clock, latching = True) sub = nh.subscribe('clock2', Clock) - await asyncio.gather(sub.setup(), sub.setup()) - subsub_task = asyncio.create_task(subsub(nh, sub, sub)) + await asyncio.gather(pub.setup(), sub.setup()) + pubsub_task = asyncio.create_task(pubsub(nh, pub, sub)) print("Everything is setup. Waiting two seconds.") await asyncio.sleep(2) - subsub_task.cancel() + pubsub_task.cancel() if __name__ == "__main__": uvloop.install() @@ -62,8 +62,8 @@ The node handle can be used for general purposes, such as parameters and sleepin This parameter does not exist! >>> await nh.sleep(2) # Sleeps for 2 seconds -The node handle can also be used for sublishing and subscribing to topics. Note -that all sublishers and subscribers must be setup. +The node handle can also be used for publishing and subscribing to topics. Note +that all Publishers and subscribers must be setup. .. code-block:: python @@ -71,19 +71,19 @@ that all sublishers and subscribers must be setup. >>> import axros >>> nh = await axros.NodeHandle("/test", "special_node", "localhost", os.environ["ROS_MASTER_URI"], {}) >>> from std_msgs.msg import Int32 - >>> sub = nh.advertise("running_time", Int32) - >>> await sub.setup() - >>> async def sublish(): + >>> pub = nh.advertise("running_time", Int32) + >>> await pub.setup() + >>> async def publish(): ... try: ... count = 0 ... while True: - ... sub.sublish(Int32(count)) + ... pub.publish(Int32(count)) ... count += 1 ... await asyncio.sleep(1) ... except asyncio.CancelledError as _: - ... # When task gets cancelled, stop sublishing + ... # When task gets cancelled, stop publishing ... pass - >>> task = asyncio.create_task(sublish()) # Start sublishing! + >>> task = asyncio.create_task(publish()) # Start publishing! >>> sub = nh.subscribe("running_time", Int32) >>> await sub.setup() >>> while True: diff --git a/mil_common/axros b/mil_common/axros index d0f12eedb..8cdf13186 160000 --- a/mil_common/axros +++ b/mil_common/axros @@ -1 +1 @@ -Subproject commit d0f12eedb4622f5bbc5ba4fb63ae350f27a51f4b +Subproject commit 8cdf131866af08edf0bbe3ac9020e1da47b3e432