-
Notifications
You must be signed in to change notification settings - Fork 523
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
Add parameter default_planning_scene
to load planning scene geometry on startup
#2949
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Paul Gesel <paul.gesel@picknik.ai>
Signed-off-by: Paul Gesel <paul.gesel@picknik.ai>
Signed-off-by: Paul Gesel <paul.gesel@picknik.ai>
Signed-off-by: Paul Gesel <paul.gesel@picknik.ai>
Signed-off-by: Paul Gesel <paul.gesel@picknik.ai>
Signed-off-by: Paul Gesel <paul.gesel@picknik.ai>
Signed-off-by: Paul Gesel <paul.gesel@picknik.ai>
Signed-off-by: Paul Gesel <paul.gesel@picknik.ai>
Signed-off-by: Paul Gesel <paul.gesel@picknik.ai>
std::string path = nh->get_parameter("default_planning_scene").as_string(); | ||
std::fstream file_stream; | ||
file_stream.open(path, std::fstream::in); | ||
if (!file_stream.is_open() || !ps->loadGeometryFromStream(file_stream)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is too dangerous because you're not locking the planning scene when writing to it (see
Line 170 in 19d4a28
* @warning Most likely you do not want to call this function |
You can get thread safe access like this:
{
planning_scene_monitor::LockedPlanningSceneRW ps = planning_display_->getPlanningSceneRW();
if (ps)
FANCY MODIFICATIONS
} // End scope to release lock
Signed-off-by: Paul Gesel <paul.gesel@picknik.ai>
This PR is stale because it has been open for 45 days with no activity. Please tag a maintainer for help on completing this PR, or close it if you think it has become obsolete. |
@pac48 Should we close this? |
@sjahr We should try to merge this. I think the change to the test should either be deleted or more effort has to be put in to make it not flaky. |
Description
This PR adds a new parameter to the
move_group
node that allows users to specify a planning scene file to load on startup. The parameter is a string containing the absolute file path. The parameter can be set with either$(find-pkg-share pkg-wth-planning-file)
for XML orament_index_python.packages.get_package_share_directory
in Python to facilitate specifying the path. If the parameter is not specified, themove_group
node will behave as it previously did. If there is an error loading the file, the node will exit with a fatal error.Checklist