Skip to content

Add Open-RMF CCBS based planner as an option - #40

Draft
arjo129 wants to merge 6 commits into
open-rmf:mainfrom
arjo129:arjoc/feat/add_ccbs_option
Draft

Add Open-RMF CCBS based planner as an option#40
arjo129 wants to merge 6 commits into
open-rmf:mainfrom
arjo129:arjoc/feat/add_ccbs_option

Conversation

@arjo129

@arjo129 arjo129 commented Jul 15, 2026

Copy link
Copy Markdown
Member

New feature implementation

Implemented feature

Adds a planner based on https://github.com/open-rmf/mapf

Implementation description

You can now switch between PIBT/CCBS. This showcases the flexibility of the new architecture.

GenAI Use

We follow OSRA's policy on GenAI tools

  • I used a GenAI tool in this PR.
  • I did not use GenAI

Generated-by:

@mxgrey mxgrey added this to PMC Board Jul 15, 2026
@github-project-automation github-project-automation Bot moved this to Inbox in PMC Board Jul 15, 2026
@mxgrey mxgrey moved this from Inbox to In Progress in PMC Board Jul 28, 2026
@mxgrey

mxgrey commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@SamuelFoo to review

@SamuelFoo SamuelFoo left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, left some comments :)

let q = &odom.pose.pose.orientation;
let yaw = 2.0 * f64::atan2(q.z as f64, q.w as f64);

let start_cell = Cell::from_point(Point::new(sx_local, sy_local), cell_size);

@SamuelFoo SamuelFoo Aug 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there might be a half-cell offset here.

Cell::from_point seems to floor on the way in, but the trajectory comes back out of AccessibilityGraph::vertex via Cell::center_point i.e. (idx + 0.5) * cell_size, so the round trip may not be symmetric. This causes an error of at most cell_size / 2 per axis (e.g., with integer coordinates +0.5 * cell_size in x and y).

start: [start_cell.x, start_cell.y],
yaw,
goal: [goal_cell.x, goal_cell.y],
radius: 0.45,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we take the radius from _footprints rather than hardcoding 0.45?

Comment on lines +319 to +323
let cell_size = if map.grid.info.resolution > 0.0 {
map.grid.info.resolution as f64
} else {
1.0
};

@SamuelFoo SamuelFoo Aug 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think cell_size = map.grid.info.resolution might be a problem on the real maps.

The demo grid is 1.0 m/cell, but the maps in this repo are 0.03 m (warehouse.yaml) and 0.05 m (depot.yaml).

It also looks like Accessibility::new(grid, 0.45) would compute cell_shift = ceil(0.45/0.03 + 0.5) = 16, which I think inflates obstacles by 16 cells in every direction.

Would it make sense to decouple the planning resolution from the map resolution?

Comment on lines +328 to +339
let mut occupancy: HashMap<i64, Vec<i64>> = HashMap::new();
let w = map.grid.info.width as usize;
let h = map.grid.info.height as usize;
if w > 0 && h > 0 {
for x in 0..w {
for y in 0..h {
let ros_val = map.grid.data[y * w + x];
if ros_val > 50 || ros_val == -1 {
occupancy.entry(y as i64).or_default().push(x as i64);
}
}
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since only occupied cells reach the SparseGrid, I think everything outside the map rectangle may read as free.

Scenario.occupancy doesn't seem to carry an extent, and negotiate builds SparseGrid::new(cell_size) from the occupied cells alone (mapf/src/negotiation/mod.rs:104-113). For demo_grid.png, which has no border wall, the paths seem able to leave the mapped area.

Maybe we can mark the ring of cells just outside the grid as occupied?

))
})?;

for wp in proposal.meta.trajectory.iter() {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like wp.time gets discarded, and the pipeline then re-times the path uniformly. Is it intentional to not follow the CCBS output schedule?

Comment thread path_server/rmf_path_server/src/main.rs Outdated
rclrs::log!(node.logger(), "Using CCBS planner");
Box::new(CcbsPlanner::default())
}
"pibt-grid-world" | _ => {

@SamuelFoo SamuelFoo Aug 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Typos (e.g., ccbss) may cause PIBT to be selected.

@mxgrey mxgrey moved this from In Progress to In Review in PMC Board Aug 25, 2026
Declare startup parameters for the PIBT grid resolution and global robot footprint. Apply the configured resolution to mapped and mapless planning while preserving the existing defaults.

Signed-off-by: SamuelFoo <fooenzesamuel@gmail.com>
Remove the global robot footprint parameter while its interface is still under discussion. Preserve the existing 0.49 m fallback behavior.

Signed-off-by: SamuelFoo <fooenzesamuel@gmail.com>
Keep the default grid resolution private to the library crate. Read the executable's parameter default from PibtPlanner instead of exporting the constant.

Signed-off-by: SamuelFoo <fooenzesamuel@gmail.com>
Document the planning_grid_resolution startup parameter and align its help text with the repository's terminology.

Signed-off-by: SamuelFoo <fooenzesamuel@gmail.com>
Signed-off-by: SamuelFoo <fooenzesamuel@gmail.com>
@arjo129
arjo129 force-pushed the arjoc/feat/add_ccbs_option branch from 2c23b1c to 9de1aa3 Compare September 1, 2026 07:21
@arjo129
arjo129 changed the base branch from epic/next-gen-base to main September 1, 2026 07:25
… with planning grid resolution

- Add CcbsPlanner implementing MapfPlanner using mapf crate
- Implement MapfPlanner for Box<dyn MapfPlanner> and Arc<dyn MapfPlanner>
- Reconcile main.rs to support both planner parameter ('pibt-grid-world' / 'ccbs') and planning_grid_resolution parameter
- Add fine-resolution demo grid (0.1m) and updated launch scripts in rmf_path_server_demo
- Add test_ccbs_planner integration test suite

Signed-off-by: Arjo Chakravarty <arjoc@intrinsic.ai>
@arjo129
arjo129 force-pushed the arjoc/feat/add_ccbs_option branch from 9de1aa3 to 5706be4 Compare September 1, 2026 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

3 participants