Skip to content

move nav_2d_msgs & nav_2d_utils out of nav2_dwb_controller#5390

Closed
adivardi wants to merge 1 commit intoros-navigation:mainfrom
adivardi:av/nav2_dwb
Closed

move nav_2d_msgs & nav_2d_utils out of nav2_dwb_controller#5390
adivardi wants to merge 1 commit intoros-navigation:mainfrom
adivardi:av/nav2_dwb

Conversation

@adivardi
Copy link
Copy Markdown
Contributor


Basic Info

Info Please fill out this column
Ticket(s) this addresses -
Primary OS tested on Ubuntu
Robotic platform tested on nav2 docker container
Does this PR contain AI generated software? No
Was this PR description generated by AI software? No

Description of contribution in a few bullet points

Move nav_2d_msgs & nav_2d_utils out of nav2_dwb_controller, as they are used by other packages as well.
Motivation:

  • make packages locations more transparent and intiuitive
  • make it easier to find dependencies for a package
  • simplify partially building nav2 from source

Description of documentation updates required from your changes

None

Description of how this change was tested

Built from nav2 source with full build, --packages-up-to nav2_controller, --packages-up-to nav2_dwb_controller


Future work that may be required in bullet points

For Maintainers:

  • Check that any new parameters added are updated in docs.nav2.org
  • Check that any significant change is added to the migration guide
  • Check that any new features OR changes to existing behaviors are reflected in the tuning guide
  • Check that any new functions have Doxygen added
  • Check that any new features have test coverage
  • Check that any new plugins is added to the plugins page
  • If BT Node, Additionally: add to BT's XML index of nodes for groot, BT package's readme table, and BT library lists
  • Should this be backported to current distributions? If so, tag with backport-*.

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jul 25, 2025

This pull request is in conflict. Could you fix it @adivardi?

@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jul 25, 2025

@adivardi, your PR has failed to build. Please check CI outputs and resolve issues.
You may need to rebase or pull in main due to API changes (or your contribution genuinely fails).

As they are used by other packages as well

Signed-off-by: Adi Vardi <adi.vardi@enway.ai>
@mergify
Copy link
Copy Markdown
Contributor

mergify bot commented Jul 25, 2025

@adivardi, your PR has failed to build. Please check CI outputs and resolve issues.
You may need to rebase or pull in main due to API changes (or your contribution genuinely fails).

@SteveMacenski
Copy link
Copy Markdown
Member

I understand the impulse, but these packages are specific to DWB even if they don't have a dwb_ prefix. They are not recommended to be used by applications so I would actually prefer to leave them as-is and recommend that you do not rely on them in the future.

I did just check and it looks like we use them in the nav2_controller (which I tracked down to the very earliest of days in Nav2 back when we only supported the DWB controller) which I think would actually be better to remove rather than add the packages to the general root directory.

@mini-1235
Copy link
Copy Markdown
Collaborator

I think nav_2d_utils can be removed actually

template<class param_t>
param_t searchAndGetParam(
const nav2::LifecycleNode::SharedPtr & nh, const std::string & param_name,
const param_t & default_value)
{
nav2::declare_parameter_if_not_declared(
nh, param_name,
rclcpp::ParameterValue(default_value));
return nh->get_parameter(param_name).get_value<param_t>();

we have this in nav2_util already

OdomSubscribr and tf_help can be moved to nav2_util, as they are used in many parts of the code

Are Twist2dto3d and 3dto2d needed? I think we can remove the 2d one(?)

@adivardi
Copy link
Copy Markdown
Contributor Author

I understand the impulse, but these packages are specific to DWB even if they don't have a dwb_ prefix. They are not recommended to be used by applications so I would actually prefer to leave them as-is and recommend that you do not rely on them in the future.

I did just check and it looks like we use them in the nav2_controller (which I tracked down to the very earliest of days in Nav2 back when we only supported the DWB controller) which I think would actually be better to remove rather than add the packages to the general root directory.

I moved them out because they are used in nav2_controller. nav_2d_utils is used in many controllers for the transformPose.

By remove, do you mean remove the dependency? Then can we remove the Twist2D and all its usages like @mini-1235 suggested?

@SteveMacenski
Copy link
Copy Markdown
Member

@mini-1235 it is probably likely that some or all of these can be removed, you're right. I didn't spend much time on that since it wasn't critical. If you felt inclined to do so, I'll never argue with maintaining less code 😉 These were just how David implemented DWB back in the Locus robot_navigation package that was 1:1 forward ported here.

@adivardi I see. My preference would actually be on @mini-1235 's direction of moving any useful utilities to nav2_utils, updating non-DWB packages to use Nav2's main util package, and remove the package possibly if the migration within DWB is desirable.

Sorry, that was my mistake in being precise. By 'remove' I meant to remove the use of these packages in other non-DWB packages so it is isolated back into DWB again.

@mini-1235 mini-1235 mentioned this pull request Aug 3, 2025
8 tasks
@SteveMacenski
Copy link
Copy Markdown
Member

Closing with the new PR taking priority

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants