Skip to content

Add explicit rmf_traffic dependencies - #145

Merged
mxgrey merged 1 commit into
open-rmf:mainfrom
Plumezz:add-explicit-rmf-traffic-dependencies
Sep 7, 2026
Merged

Add explicit rmf_traffic dependencies#145
mxgrey merged 1 commit into
open-rmf:mainfrom
Plumezz:add-explicit-rmf-traffic-dependencies

Conversation

@Plumezz

@Plumezz Plumezz commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

This PR adds explicit rmf_traffic dependency declarations for rmf_task and rmf_task_sequence.

Both packages directly use rmf_traffic types in their public headers and implementation code. For example:

  • rmf_task includes rmf_traffic/Time.hpp, rmf_traffic/Trajectory.hpp, and rmf_traffic/agv/Planner.hpp in request/task planning headers.
  • rmf_task_sequence uses rmf_traffic::Time, rmf_traffic::Duration, and rmf_traffic::agv::Plan::Goal in its public task, activity, and event APIs.

Currently these packages can receive rmf_traffic transitively through other RMF dependencies, but the direct source usage is not fully reflected in package metadata.

Changes:

  • Add <depend>rmf_traffic</depend> to rmf_task/package.xml.
  • Add <depend>rmf_traffic</depend> to rmf_task_sequence/package.xml.
  • Add find_package(rmf_traffic REQUIRED) to rmf_task_sequence/CMakeLists.txt.
  • Link rmf_task_sequence against rmf_traffic::rmf_traffic.
  • Link rmf_task against rmf_traffic::rmf_traffic.
  • Add find_dependency(rmf_traffic) to rmf_task_sequence's exported CMake config.

rmf_task already had find_package(rmf_traffic REQUIRED) and find_dependency(rmf_traffic), so the change there only updates package.xml to match the existing CMake dependency.

@mxgrey mxgrey added this to PMC Board Jul 6, 2026
@github-project-automation github-project-automation Bot moved this to Inbox in PMC Board Jul 6, 2026
@Plumezz
Plumezz force-pushed the add-explicit-rmf-traffic-dependencies branch from 3560058 to 2f5f0e1 Compare July 6, 2026 10:49
include(CMakeFindDependencyMacro)

find_dependency(rmf_task)
find_package(rmf_traffic REQUIRED)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not very familiar with this part of the code but it seems this is only to generate the header with the schema as a string, so we might not need to add any dependency?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for pointing this out.

You are right that the schema header generation itself does not need rmf_traffic. My intention here was not to support the schema generation step, but to export the dependency required by the public C++ API of rmf_task_sequence.

rmf_task_sequence exposes rmf_traffic types in public headers, for example rmf_traffic::Time, rmf_traffic::Duration, and rmf_traffic::agv::Plan::Goal. So downstream packages that call find_package(rmf_task_sequence) may also need the rmf_traffic dependency to be discoverable.

That said, I also noticed I used find_package(rmf_traffic REQUIRED) in the config template, which should be find_dependency(rmf_traffic) to match the other exported dependencies. I will update that.

target_link_libraries(rmf_task_sequence
PUBLIC
rmf_task::rmf_task
rmf_traffic::rmf_traffic

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I noticed that rmf_task is missing this dependency in its library, should it be added there as well?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good point, yes, I agree. I think it should be added as well.

I will update the PR.

@Plumezz
Plumezz force-pushed the add-explicit-rmf-traffic-dependencies branch 2 times, most recently from 73f62c3 to 44735e6 Compare July 6, 2026 13:27
Signed-off-by: Guanxiao Qi <944843236@qq.com>
@Plumezz
Plumezz force-pushed the add-explicit-rmf-traffic-dependencies branch from 44735e6 to 0ea0dc0 Compare July 6, 2026 13:30
@mxgrey mxgrey moved this from Inbox to In Review in PMC Board Jul 14, 2026
@mxgrey
mxgrey requested a review from arjo129 August 11, 2026 01:08
@mxgrey
mxgrey merged commit f0347c1 into open-rmf:main Sep 7, 2026
13 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in PMC Board Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants