-
Notifications
You must be signed in to change notification settings - Fork 533
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
Open
pac48
wants to merge
19
commits into
moveit:main
Choose a base branch
from
pac48:pr-load-default-planning-scene
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
91c18d1
Add parameter to load planning scene geometry on startup
pac48 36adcf4
add error check
pac48 3fbe0a8
fix potentially insecure
pac48 873bf5c
add python test launch file
pac48 a14e2c6
add test files
pac48 2f8b28d
test working unless run in parallel
pac48 8a0de0e
fix islated pytest
pac48 cbd89c5
add comments and fix isolated
pac48 5008dda
make test more robust
pac48 fc1bac2
add locked planning scene
pac48 b266f55
Merge branch 'main' into pr-load-default-planning-scene
sjahr 55f066b
Merge branch 'main' into pr-load-default-planning-scene
sjahr a1cd7b0
Merge branch 'main' into pr-load-default-planning-scene
sjahr 9afaaf5
Merge branch 'main' into pr-load-default-planning-scene
pac48 9b47cde
undo header change
pac48 4eef9ee
revert test changes
pac48 eb5e1e6
run format
pac48 7e4e0c6
add move_group_api.test.py back
pac48 6bd6775
Merge branch 'main' into pr-load-default-planning-scene
sjahr File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -290,8 +290,26 @@ int main(int argc, char** argv) | |
const auto moveit_cpp = std::make_shared<moveit_cpp::MoveItCpp>(nh, moveit_cpp_options); | ||
const auto planning_scene_monitor = moveit_cpp->getPlanningSceneMonitorNonConst(); | ||
|
||
if (planning_scene_monitor->getPlanningScene()) | ||
if (auto ps = planning_scene_monitor->getPlanningScene()) | ||
{ | ||
if (nh->has_parameter("default_planning_scene")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am a bit concerned about tying this to only the existence of the parameter. How about checking whether or not the parameter is set. const auto default_planning_scene_file = std::string();
nh->get_parameter_or("default_planning_scene", default_planning_scene_file, std::string());
// Maybe add function to validate the string pattern if it actually representing path
if(validateFilePath(default_planning_scene_file))
{
...
}
|
||
{ | ||
std::string path = nh->get_parameter("default_planning_scene").as_string(); | ||
std::fstream file_stream; | ||
file_stream.open(path, std::fstream::in); | ||
planning_scene_monitor::LockedPlanningSceneRW locked_ps(planning_scene_monitor); | ||
if (!file_stream.is_open() || !locked_ps->loadGeometryFromStream(file_stream)) | ||
{ | ||
RCLCPP_ERROR(nh->get_logger(), std::string("Failed to load the planning scene geometry from the file specified " | ||
"by the `default_planning_scene` parameter. The " | ||
"`default_planning_scene` parameter was set to ") | ||
.append(path) | ||
.append(".") | ||
.c_str()); | ||
|
||
return 0; | ||
} | ||
} | ||
bool debug = false; | ||
for (int i = 1; i < argc; ++i) | ||
{ | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Given that
ps
is never used, would make sense to revert this change?