Work in progress: this documentation is still being written and reviewed. Check details against the source code.

Octomap scene bridge

ROS bridge from Octomap messages to differential MoveIt PlanningScene messages. The bridge assumes incoming maps already use the intended frame; it does not transform their geometry.

beambot.mapping.octomap_to_planning_scene · Source

Perception and mapping · Guide · Symbol index

How it is used

The mapping launch uses this ROS node to forward incoming Octomaps as MoveIt planning-scene diffs. main() owns the node lifecycle; _octomap_callback() performs the conversion and throttles repeated updates.

The bridge copies map data and its frame information; it neither transforms the geometry nor waits for a MoveIt acknowledgement. Configure the upstream mapping frame to match the intended scene frame.

Start here

Callable

Purpose

main

Initialize and spin the Octomap bridge, then log counters and shut down.

OctomapToPlanningScene._octomap_callback

Publish the first incoming map immediately, then throttle later PlanningScene diffs using elapsed monotonic time.

Functions

main()

Initialize and spin the Octomap bridge, then log counters and shut down.

Entry point · Source

main(args=None)

Parameter

Meaning

args

Optional ROS command-line arguments passed to rclpy.init().

Returns: None after shutdown.

Errors: KeyboardInterrupt during spin is swallowed. Other spin exceptions propagate after finally cleanup; constructor errors occur before that try block.

Side effects: Starts ROS, creates the bridge, blocks in spin, destroys the node, and calls rclpy.shutdown().

OctomapToPlanningScene

ROS subscriber/publisher bridge for Octomap updates. It tracks publication timing and counts; scene application is asynchronous.

Inherits from: Node.

OctomapToPlanningScene._octomap_callback()

Publish the first incoming map immediately, then throttle later PlanningScene diffs using elapsed monotonic time.

Callback · Source

_octomap_callback(self, octomap_msg: Octomap)

Parameter

Meaning

octomap_msg

Octomap message already in the intended world frame; header and map content are preserved.

Returns: None; throttled calls return before publishing.

Errors: No local exception handler, coordinate transform or origin validation. The callback leaves world.octomap.origin at the message defaults rather than explicitly setting an identity quaternion.

Side effects: Copies the map/header into a PlanningScene diff, publishes it, increments sent/throttled counters, updates the last-send time and optionally logs. Publication does not wait for MoveGroup acknowledgement.

Referenced in source (1)

OctomapToPlanningScene.__init__()

Create map input and scene output ROS endpoints and initialize update throttling.

Lifecycle · Source

__init__(self)

Returns: None; initializes the ROS node.

Errors: ROS initialization/parameter/entity errors propagate.

Side effects: Declares octomap_topic=/octomap_binary, planning_scene_topic=/planning_scene, min_update_interval=0.5 seconds, and log_updates=true. Creates reliable volatile subscription/publisher and counters.

Referenced in source (1)
  • main — beambot.mapping.octomap_to_planning_scene