Skip to content

Added planning scene tests - #667

Merged
rhaschke merged 4 commits into
moveit:kinetic-develfrom
shadow-robot:F#643_add_PlanningScene_tests
May 26, 2018
Merged

rhaschke merged 4 commits into
moveit:kinetic-develfrom
shadow-robot:F#643_add_PlanningScene_tests

Conversation

@AndriyPt

@AndriyPt AndriyPt commented Oct 19, 2017 •

Copy link
Copy Markdown
Contributor

This is some kind of refactoring which will allow to add more tests easily. Related to #643

@v4hn v4hn mentioned this pull request Dec 18, 2017

@rhaschke rhaschke left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Added functions to load both urdf and srdf models is good. The actually added test can be neglected. You should definitely actuate some robot poses with known collision state and validate the API against them.

robot_state::RobotState current_state = ps->getCurrentState();
if (ps->isStateColliding(current_state, "left_arm"))
{
EXPECT_FALSE(ps->isStateValid(current_state, "left_arm"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This test isn't very useful, isn't it?
I think tests should verify the correct working of the API. In this particular example, you should set up some robot poses, that are known to collide/not collide and validate the result of isStateColliding().
Or you should set up some constraints that are fulfilled or not and validate isStateFeasible().

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@rhaschke Thank you for feedback. Work was done in the limited amount of time during World MoveIt Day 2017. Hopefully I will find some time to add suggested improvements before next WMD 2018 :)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems useful enough to me... you use two different calls to verify expected behavior of invalid states.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It's worth picking up these little bits. The more tests the better.

itssomething

robot_state::RobotState current_state = ps->getCurrentState();
if (ps->isStateColliding(current_state, "left_arm"))
{
EXPECT_FALSE(ps->isStateValid(current_state, "left_arm"));

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This seems useful enough to me... you use two different calls to verify expected behavior of invalid states.

loadRobotModel(robot_model_out);
std::string xml_string;
loadModelFile("pr2_description/srdf/robot.xml", xml_string);
srdf_model_out->initString(*robot_model_out, xml_string);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Ideally all tests would use the same test utilities for loading URDFs / SRDFs instead of remunerating them in every test. I have the same suggestion for a test @mlautman is working on in fact.

MoveIt! already has common file loading functionality for URDF / SRDF here - can that be reused in this file?

@rhaschke
rhaschke merged commit 4fedbd5 into moveit:kinetic-devel May 26, 2018
rhaschke pushed a commit to ubi-agni/moveit that referenced this pull request May 26, 2018
- use common functions for model loading
- added small set of validations
@AndriyPt
AndriyPt deleted the F#643_add_PlanningScene_tests branch May 29, 2018 08:38
dg-shadow pushed a commit to shadow-robot/moveit that referenced this pull request Jul 30, 2018
- use common functions for model loading
- added small set of validations
JafarAbdi added a commit to JafarAbdi/moveit that referenced this pull request Mar 24, 2022
* Error if Octomap 'map_frame' is not provided

* "octomap_frame", not "map_frame"

Co-authored-by: Jafar Abdi <[email protected]>

Co-authored-by: Jafar Abdi <[email protected]>
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.

4 participants