LCAS / topological_navigation

The topological navigation framework
Apache License 2.0
31 stars 36 forks source link

Topological map manager now working under ROS2 #161

Closed Iranaphor closed 10 months ago

Iranaphor commented 1 year ago

The changes in this PR are mostly syntactic to port rospy components such as init_node, loginfo, Service, Publisher, get_param, rospkg. This PR also contains (most importantly) the specification of the topological_map topic, which now coincides with ROS2 upgrades to message latching.

ROS2 has upgraded the processes by which latching of messages is handled. Detailed here. In brief, ROS1 subscribers can be thought of having no bearing on the state of a latched message. In ROS2, a publisher can specify how much message history should be accessible, then a subscriber can request how much of the message history to access on connection. Any subscriptions to topological_navigation from other nodes or connecting systems must now specify, explicitly, to access the last saved message, rather then relying on this automatically coming in on connection.

This PR is planned to get working; the map manager, route planner, and map restrictions.

Iranaphor commented 1 year ago

Once the map manager is launched, the topological map can be accessed by the following:

from rclpy.qos import QoSProfile, DurabilityPolicy
qos = QoSProfile(depth=1, durability=DurabilityPolicy.TRANSIENT_LOCAL)
self.tmap = self.create_subscription(String, '/topological_map_2', self.cb, qos)