Robot independent test class setup. More...
#include <load_test_robot.h>
Protected Member Functions | |
LoadTestRobot (const std::string &robot_name, const std::string &group_name) | |
Protected Attributes | |
std::string | base_link_name_ |
std::string | ee_link_name_ |
const std::string | group_name_ |
const robot_state::JointModelGroup * | joint_model_group_ |
std::size_t | num_dofs_ |
moveit::core::RobotModelPtr | robot_model_ |
const std::string | robot_name_ |
robot_state::RobotStatePtr | robot_state_ |
Robot independent test class setup.
The desired robot tests can be impelmented in a derived class in a generic way.
It is implemented this way to avoid the ros specific test framework outside moveit_ros.
(This is an (uglier) alternative to using the rostest framework and reading the robot settings from the parameter server. Then we have several rostest launch files that load the parameters for a specific robot and run the same compiled tests for all robots.)
based on https://stackoverflow.com/questions/38207346/specify-constructor-arguments-for-a-google-test-fixture/38218657 (answer by PiotrNycz)
— example.cpp —
#include <gtest/gtest.h> #include "load_test_robot.h"
class GenericTests : public ompl_interface_testing::LoadTestRobot, public testing::Test { public: GenericTests(const std::string& robot_name, const std::string& group_name) : LoadTestRobot(robot_name, group_name) { } void SetUp() override { } void TearDown() override { }
void someTest() { // use robot_model_, robot_state_, .. here EXPECT_TRUE(true); } };
// now you can run someTest()
on different robots:
class PandaTest : public GenericTests { protected: PandaTest() : GenericTests("panda", "panda_arm") { } };
TEST_F(PandaTest, someTest) { someTest(); }
— end example.cpp —
Definition at line 130 of file load_test_robot.h.
|
inlineprotected |
Definition at line 165 of file load_test_robot.h.
|
protected |
Definition at line 191 of file load_test_robot.h.
|
protected |
Definition at line 192 of file load_test_robot.h.
|
protected |
Definition at line 183 of file load_test_robot.h.
|
protected |
Definition at line 188 of file load_test_robot.h.
|
protected |
Definition at line 190 of file load_test_robot.h.
|
protected |
Definition at line 186 of file load_test_robot.h.
|
protected |
Definition at line 184 of file load_test_robot.h.
|
protected |
Definition at line 187 of file load_test_robot.h.