moveit2
The MoveIt Motion Planning Framework for ROS 2.
Loading...
Searching...
No Matches
moveit_planners
chomp
chomp_interface
test
chomp_moveit_test_panda.cpp
Go to the documentation of this file.
1
/*********************************************************************
2
* Software License Agreement (BSD License)
3
*
4
* Copyright (c) 2024, Sherbrooke University
5
* All rights reserved.
6
*
7
* Redistribution and use in source and binary forms, with or without
8
* modification, are permitted provided that the following conditions
9
* are met:
10
*
11
* * Redistributions of source code must retain the above copyright
12
* notice, this list of conditions and the following disclaimer.
13
* * Redistributions in binary form must reproduce the above
14
* copyright notice, this list of conditions and the following
15
* disclaimer in the documentation and/or other materials provided
16
* with the distribution.
17
* * Neither the name of Willow Garage nor the names of its
18
* contributors may be used to endorse or promote products derived
19
* from this software without specific prior written permission.
20
*
21
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32
* POSSIBILITY OF SUCH DAMAGE.
33
*********************************************************************/
34
36
37
#include <ros/ros.h>
38
#include <gtest/gtest.h>
39
40
#include <
moveit/move_group_interface/move_group_interface.h
>
41
#include <
moveit/planning_scene_interface/planning_scene_interface.h
>
42
43
class
CHOMPMoveitTest
:
public
::testing::Test
44
{
45
public
:
46
moveit::planning_interface::MoveGroupInterface
move_group_
;
47
moveit::planning_interface::MoveGroupInterface::Plan
my_plan_
;
48
49
public
:
50
CHOMPMoveitTest
() :
move_group_
(
"hand"
)
51
{
52
}
53
};
54
55
// TEST CASES
56
57
// https://github.com/moveit/moveit/issues/2542
58
TEST_F
(
CHOMPMoveitTest
, jointSpaceGoodGoal)
59
{
60
move_group_.
setStartState
(*(move_group_.getCurrentState()));
61
move_group_.setJointValueTarget(std::vector<double>({ 0.0, 0.0 }));
62
move_group_.setPlanningTime(5.0);
63
64
moveit::core::MoveItErrorCode
error_code = move_group_.plan(my_plan_);
65
EXPECT_GT(my_plan_.trajectory_.joint_trajectory.points.size(), 0u);
66
EXPECT_EQ(error_code.val, moveit::core::MoveItErrorCode::SUCCESS);
67
}
68
69
int
main
(
int
argc,
char
** argv)
70
{
71
testing::InitGoogleTest(&argc, argv);
72
ros::init(argc, argv,
"chomp_moveit_test_panda"
);
73
74
ros::AsyncSpinner spinner(1);
75
spinner.start();
76
int
ret = RUN_ALL_TESTS();
77
spinner.stop();
78
ros::shutdown();
79
return
ret;
80
}
main
int main(int argc, char **argv)
Definition
chomp_moveit_test_panda.cpp:69
TEST_F
TEST_F(CHOMPMoveitTest, jointSpaceGoodGoal)
Definition
chomp_moveit_test_panda.cpp:58
CHOMPMoveitTest
Definition
chomp_moveit_test_panda.cpp:44
CHOMPMoveitTest::my_plan_
moveit::planning_interface::MoveGroupInterface::Plan my_plan_
Definition
chomp_moveit_test_panda.cpp:47
CHOMPMoveitTest::move_group_
moveit::planning_interface::MoveGroupInterface move_group_
Definition
chomp_moveit_test_panda.cpp:46
CHOMPMoveitTest::CHOMPMoveitTest
CHOMPMoveitTest()
Definition
chomp_moveit_test_panda.cpp:50
moveit::core::MoveItErrorCode
a wrapper around moveit_msgs::MoveItErrorCodes to make it easier to return an error code message from...
Definition
moveit_error_code.h:48
moveit::planning_interface::MoveGroupInterface
Client class to conveniently use the ROS interfaces provided by the move_group node.
Definition
move_group_interface.h:76
moveit::planning_interface::MoveGroupInterface::setStartState
void setStartState(const moveit_msgs::msg::RobotState &start_state)
If a different start state should be considered instead of the current state of the robot,...
Definition
move_group_interface.cpp:1479
move_group_interface.h
planning_scene_interface.h
moveit::planning_interface::MoveGroupInterface::Plan
The representation of a motion plan (as ROS messages)
Definition
move_group_interface.h:108
Generated by
1.9.8