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

Added mutex to prevent SEGFAULT on map change in AMCL #2933

Merged
merged 2 commits into from
May 5, 2022

Conversation

mrmara
Copy link
Contributor

@mrmara mrmara commented May 4, 2022


Basic Info

Info Please fill out this column
Ticket(s) this addresses (#2931 )
Primary OS tested on Ubuntu 20.04.3 LTS
Robotic platform tested on Simulation

Description of contribution in a few bullet points

Fixed Segmentation Fault happening in map_calc_range() if new laserscans were processed during a map change event.
This was done by adding configuration_mutex_ lock on laserscan callback. Mutex lock has been added also to other methods accordingly to ROS Noetic implementation

Description of documentation updates required from your changes

none


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

@mergify
Copy link
Contributor

mergify bot commented May 4, 2022

@mrmara, please properly fill in PR template in the future. @SteveMacenski, use this instead.

  • 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

@mrmara mrmara changed the title Added mutex to prevent SEGFAULT on map change Added mutex to prevent SEGFAULT on map change in AMCL May 4, 2022
Copy link
Member

@SteveMacenski SteveMacenski left a comment

Choose a reason for hiding this comment

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

I think we can rename one of these mutexes to just the mutex_ and that's used in all of the places that these 2 are used. There's no reason to have both locked in all situations.

@mrmara
Copy link
Contributor Author

mrmara commented May 5, 2022

I think we can rename one of these mutexes to just the mutex_ and that's used in all of the places that these 2 are used. There's no reason to have both locked in all situations.

Yes, you are right! I just pushed the modifications.
Anyway, the automatic tests keep failing but I do not understand what is wrong, is it normal?

@padhupradheep
Copy link
Member

Anyway, the automatic tests keep failing but I do not understand what is wrong, is it normal?

In short, you do not have to worry about it.. :-)

@SteveMacenski SteveMacenski merged commit febb12a into ros-navigation:main May 5, 2022
SteveMacenski pushed a commit that referenced this pull request May 6, 2022
* Added mutex to prevent SEGFAULT on map change

* Removing redundant mutex

Co-authored-by: Antonio Marangi <antonio.marangi@alba-robot.com>
SteveMacenski added a commit that referenced this pull request May 6, 2022
* fix invert logic (#2772)

* Bugfix tf lookup of goal pose in nav2_controller (#2780)

Signed-off-by: Erik Örjehag <erik@orjehag.se>

* Feature to call controller action server to follow path (#2789)

* Added call to controller action server with a path to follow
++ Added a new function  in robot_navigator,py
++ Added a launch script to test  function
++ Updated setup.py to include demo_follow_path.py

* Code refactoring

* Code refactoring

* Code refactoring for consistency

* Updated README.md

* Resolved executable conflict in setup.py for example_follow_path.py

* Code refactoring with  ament_flake8

* Add recoveries to simple commander (#2792)

* fix Typo

* add recoveries

* add docs

* added demo using backup and spin

* rename isNavigationComplete to isTaskComplete

* rename cancelNav to cancelTask

* add prints

* fix premature exit

* rename NavResult to TaskResult

* fix readme order

* fix import order

* renaming

* renaming

* added planner_id (#2806)

* Fixing the issue #2781: raytraceLine with same start and end point (#2784)

* Fixing the issue #2781: raytraceLine with same start and end point no longer causes segmentation fault

* Some whitespace modifications to make the code pass release_test

* Add testcase for raytraceLine the same point

Co-authored-by: Alexey Merzlyakov <60094858+AlexeyMerzlyakov@users.noreply.github.com>

* Add optional node names to wait (#2811)

* add option to specify navigator and localizer to wait for

* add docs for waituntilNav2Active

* wait for pose only for amcl

* revert order

* remove resizing on update message callback (#2818)

* restrict test_msgs to test_dependency (#2827)

Signed-off-by: Alberto Soragna <alberto.soragna@gmail.com>

* remove unused odometry smoother in bt navigator (#2829)

* remove unused odometry smoother in bt navigator

Signed-off-by: Alberto Soragna <alberto.soragna@gmail.com>

* reorganize bt navigator to shared odom_smoother object with servers

Signed-off-by: Alberto Soragna <alberto.soragna@gmail.com>

* Add all action options (#2834)

* added options

* update docs

* Adding theta* to the main packages list

* Fix: bt_navigator crashes on lc transitions (#2848)

* fix empty address access on halt all actions

* fix unsafe declaration of parameters

* restore odom smoother

* fix styling issues

* add missing semicolumn

* fix-collision checker must capture lethal before unknow (#2854)

* Removing old unused function and comment (#2863)

* Better Costmap Error Message (#2884)

* Better Costmap Error Message

* PR Feedback

* add getRobotRadius() in costmap_2d_ros (#2896)

* Add clock time to costmaps (#2899)

* update goal checker plugin to plugins (#2909)

* Allow usage of std::string in searchAndGetParam() (#2918)

* Allow usage of std::string in searchAndGetParam()

Removed also old TODO related to legacy ROS API

* Fix

* Clean up action clients in nav2_simple_commander (#2924)

* Clean up action clients in nav2_simple_commander

* Add camelCase version

* Add docs

* Added mutex to prevent SEGFAULT on map change in AMCL (#2933)

* Added mutex to prevent SEGFAULT on map change

* Removing redundant mutex

Co-authored-by: Antonio Marangi <antonio.marangi@alba-robot.com>

Co-authored-by: G.Doisy <doisyg@users.noreply.github.com>
Co-authored-by: Erik Örjehag <erik@orjehag.se>
Co-authored-by: Ekansh Sharma <ekanshh.sharma@gmail.com>
Co-authored-by: Tony Najjar <tony.najjar@logivations.com>
Co-authored-by: Joshua Wallace <47819219+jwallace42@users.noreply.github.com>
Co-authored-by: janx8r <95029851+janx8r@users.noreply.github.com>
Co-authored-by: Alexey Merzlyakov <60094858+AlexeyMerzlyakov@users.noreply.github.com>
Co-authored-by: Andrii Maistruk <71632363+andriimaistruk@users.noreply.github.com>
Co-authored-by: Alberto Soragna <alberto.soragna@gmail.com>
Co-authored-by: Erwin Lejeune <erwin.lejeune@cm-robotics.com>
Co-authored-by: Hossein Sheikhi Darani <64957461+HosseinSheikhi@users.noreply.github.com>
Co-authored-by: David V. Lu!! <davidvlu@gmail.com>
Co-authored-by: Carlos Andrés Álvarez Restrepo <candres.alv@gmail.com>
Co-authored-by: Patrick Roncagliolo <ronca.pat@gmail.com>
Co-authored-by: M. Mostafa Farzan <m2_farzan@yahoo.com>
Co-authored-by: mrmara <48493979+mrmara@users.noreply.github.com>
Co-authored-by: Antonio Marangi <antonio.marangi@alba-robot.com>
redvinaa pushed a commit to EnjoyRobotics/navigation2 that referenced this pull request Jun 30, 2022
…#2933)

* Added mutex to prevent SEGFAULT on map change

* Removing redundant mutex

Co-authored-by: Antonio Marangi <antonio.marangi@alba-robot.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