Skip to content

Use const_cast in map server dirname fallback - #6275

Merged
SteveMacenski merged 2 commits into
ros-navigation:mainfrom
Tobias-Fischer:codex/robostack-nav2-map-server-dirname-cast
Jul 22, 2026
Merged

SteveMacenski merged 2 commits into
ros-navigation:mainfrom
Tobias-Fischer:codex/robostack-nav2-map-server-dirname-cast

Conversation

@Tobias-Fischer

Copy link
Copy Markdown
Contributor

This is part of an effort to contribute RoboStack downstream patches back upstream.

Origin: patch/ros-rolling-nav2-map-server.win.patch, authored by Daisuke Nishimatsu.

nav2_map_server has a local dirname fallback for Windows. When the input has no directory separator, it returns a mutable pointer to a static "." fallback string to match the surrounding helper signature. Using const_cast keeps the existing behavior while avoiding the broader cast used downstream.

This upstreams a small RoboStack Windows portability fix for nav2_map_server.

The local dirname fallback returns a mutable char pointer but falls back to a static const "." string when no directory separator is present. Using const_cast expresses the intended qualifier conversion without the broader C-style cast used downstream.

Origin: patch/ros-rolling-nav2-map-server.win.patch, authored by Daisuke Nishimatsu.
Signed-off-by: Tobias Fischer <[email protected]>
@Tobias-Fischer

Copy link
Copy Markdown
Contributor Author

FYI @wep21 and @traversaro: I opened this while upstreaming RoboStack patches tracked in RoboStack/robostack#124. This one comes from patch/ros-rolling-nav2-map-server.win.patch.

@mergify

mergify Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@SteveMacenski

Copy link
Copy Markdown
Member

Merging #6281 imminently, check that its been merged, rebase/pull in main and I can merge if CI passes for your work!

@Tobias-Fischer

Copy link
Copy Markdown
Contributor Author

Have just rebased @SteveMacenski

@SteveMacenski
SteveMacenski merged commit db90694 into ros-navigation:main Jul 22, 2026
12 checks passed
@Tobias-Fischer
Tobias-Fischer deleted the codex/robostack-nav2-map-server-dirname-cast branch July 22, 2026 23:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants