Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In wait_action node change duration type from int to double #3871

Conversation

maksymdidukh
Copy link
Contributor


Basic Info

Info Please fill out this column
Primary OS tested on Ubuntu
Robotic platform tested on Gazebo simulation

Description of contribution in a few bullet points

wait_duration port for Wait node is an integer, so if we pass something like 1.3 or 2.42 than it will automatically cast to nearest integer value, so i changed type of this port from int to double.

Description of documentation updates required from your changes


Future work that may be required in bullet points

For Maintainers:

  • Check that any new parameters added are updated in navigation.ros.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

@@ -53,7 +53,7 @@ class WaitAction : public BtActionNode<nav2_msgs::action::Wait>
{
return providedBasicPorts(
{
BT::InputPort<int>("wait_duration", 1, "Wait time")
BT::InputPort<double>("wait_duration", 1, "Wait time")
Copy link
Contributor

@tonynajjar tonynajjar Oct 11, 2023

Choose a reason for hiding this comment

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

change the default to 1.0 to make it clearer that it's a double

@tonynajjar
Copy link
Contributor

I wanted to say that the documentation needs updating as well but it looks like it's correct already; there was a mismatch in the code: https://navigation.ros.org/configuration/packages/bt-plugins/actions/Wait.html

@tonynajjar
Copy link
Contributor

There are also a bunch of trees that use Wait with an int, example. I know it still works like that and it's not a big deal but it's slightly cleaner imo to have them as doubles as well

@maksymdidukh
Copy link
Contributor Author

There are also a bunch of trees that use Wait with an int, example. I know it still works like that and it's not a big deal but it's slightly cleaner imo to have them as doubles as well

done))

@SteveMacenski
Copy link
Member

@maksymdidukh check CI, you have linting issues: https://app.circleci.com/pipelines/github/ros-planning/navigation2/10176/workflows/cbd18739-840b-42e8-bd73-899603ec4e9d/jobs/32314/tests

Also, this will need documentation updates in the migration guide that we're changing the type of an input. Please open a Migration Guide PR as well

@mergify
Copy link
Contributor

mergify bot commented Oct 12, 2023

@maksymdidukh, 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).

@maksymdidukh
Copy link
Contributor Author

maksymdidukh commented Oct 12, 2023

@maksymdidukh check CI, you have linting issues: https://app.circleci.com/pipelines/github/ros-planning/navigation2/10176/workflows/cbd18739-840b-42e8-bd73-899603ec4e9d/jobs/32314/tests

Also, this will need documentation updates in the migration guide that we're changing the type of an input. Please open a Migration Guide PR as well

here is a link for Migration PR ros-navigation/docs.nav2.org#476

@maksymdidukh
Copy link
Contributor Author

failing test is unrelated to my PR

@SteveMacenski SteveMacenski merged commit 63fc6a1 into ros-navigation:main Oct 12, 2023
1 of 2 checks passed
@maksymdidukh
Copy link
Contributor Author

@SteveMacenski, could u please backport it to iron?

@SteveMacenski
Copy link
Member

Unfortunately no, this breaks ABI using different data types. I’d be OK fudging it for something this minor if you can show that current behavior trees with int’s set in the BT XML still work and are cast correctly. If not, we can’t break everyone’s existing BTs mid-distro

maksymdidukh added a commit to logivations/navigation2 that referenced this pull request Oct 16, 2023
…gation#3871)

* change duration tyype from int to double

* change "1" to "1.0" as default wait_duration value

* modify wait_action tests

* fix

* change int values to double in trees

* add usage of Duration::from_seconds()

* fix build failing issue

* delete whitespace
enricosutera pushed a commit to enricosutera/navigation2 that referenced this pull request May 19, 2024
…gation#3871)

* change duration tyype from int to double

* change "1" to "1.0" as default wait_duration value

* modify wait_action tests

* fix

* change int values to double in trees

* add usage of Duration::from_seconds()

* fix build failing issue

* delete whitespace

Signed-off-by: enricosutera <enricosutera@outlook.com>
Marc-Morcos pushed a commit to Marc-Morcos/navigation2 that referenced this pull request Jul 4, 2024
…gation#3871)

* change duration tyype from int to double

* change "1" to "1.0" as default wait_duration value

* modify wait_action tests

* fix

* change int values to double in trees

* add usage of Duration::from_seconds()

* fix build failing issue

* delete whitespace
turtlewizard73 pushed a commit to EnjoyRobotics/navigation2 that referenced this pull request Oct 28, 2024
…gation#3871)

* change duration tyype from int to double

* change "1" to "1.0" as default wait_duration value

* modify wait_action tests

* fix

* change int values to double in trees

* add usage of Duration::from_seconds()

* fix build failing issue

* delete whitespace
redvinaa pushed a commit to EnjoyRobotics/navigation2 that referenced this pull request Oct 30, 2024
…gation#3871) (#30)

* change duration tyype from int to double

* change "1" to "1.0" as default wait_duration value

* modify wait_action tests

* fix

* change int values to double in trees

* add usage of Duration::from_seconds()

* fix build failing issue

* delete whitespace

Co-authored-by: maksymdidukh <142302397+maksymdidukh@users.noreply.github.com>
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.

3 participants