forked from moveit/moveit_task_constructor
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[test] duplicate scenes in Solution.msg
- Loading branch information
1 parent
5d23cb8
commit 904020f
Showing
2 changed files
with
36 additions
and
0 deletions.
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
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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#include "models.h" | ||
|
||
#include <moveit/task_constructor/task.h> | ||
#include <moveit/task_constructor/stages/fixed_state.h> | ||
|
||
#include <moveit/planning_scene/planning_scene.h> | ||
|
||
#include <ros/console.h> | ||
#include <gtest/gtest.h> | ||
|
||
using namespace moveit::task_constructor; | ||
using namespace planning_scene; | ||
using namespace moveit::core; | ||
|
||
// https://github.com/moveit/moveit_task_constructor/issues/638 | ||
TEST(SolutionMsg, DuplicateScenes) { | ||
Task t; | ||
PlanningScenePtr scene; | ||
|
||
t.setRobotModel(getModel()); | ||
scene = std::make_shared<PlanningScene>(t.getRobotModel()); | ||
t.add(std::make_unique<stages::FixedState>("start", scene)); | ||
|
||
EXPECT_TRUE(t.plan(1)); | ||
EXPECT_EQ(t.solutions().size(), 1u); | ||
|
||
// create solution | ||
moveit_task_constructor_msgs::Solution solution_msg; | ||
t.solutions().front()->toMsg(solution_msg); | ||
|
||
// all sub trajectories `scene_diff` should be a diff | ||
EXPECT_EQ(solution_msg.sub_trajectory.size(), 1u); | ||
EXPECT_EQ(solution_msg.start_scene.is_diff, false); | ||
EXPECT_EQ(solution_msg.sub_trajectory.front().scene_diff.is_diff, true); | ||
} |