Protected Member Functions | Protected Attributes | List of all members
ompl_interface_testing::LoadTestRobot Class Reference

Robot independent test class setup. More...

#include <load_test_robot.h>

Inheritance diagram for ompl_interface_testing::LoadTestRobot:
Inheritance graph
[legend]

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_
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ LoadTestRobot()

ompl_interface_testing::LoadTestRobot::LoadTestRobot ( const std::string &  robot_name,
const std::string &  group_name 
)
inlineprotected

Definition at line 165 of file load_test_robot.h.

Member Data Documentation

◆ base_link_name_

std::string ompl_interface_testing::LoadTestRobot::base_link_name_
protected

Definition at line 191 of file load_test_robot.h.

◆ ee_link_name_

std::string ompl_interface_testing::LoadTestRobot::ee_link_name_
protected

Definition at line 192 of file load_test_robot.h.

◆ group_name_

const std::string ompl_interface_testing::LoadTestRobot::group_name_
protected

Definition at line 183 of file load_test_robot.h.

◆ joint_model_group_

const robot_state::JointModelGroup* ompl_interface_testing::LoadTestRobot::joint_model_group_
protected

Definition at line 188 of file load_test_robot.h.

◆ num_dofs_

std::size_t ompl_interface_testing::LoadTestRobot::num_dofs_
protected

Definition at line 190 of file load_test_robot.h.

◆ robot_model_

moveit::core::RobotModelPtr ompl_interface_testing::LoadTestRobot::robot_model_
protected

Definition at line 186 of file load_test_robot.h.

◆ robot_name_

const std::string ompl_interface_testing::LoadTestRobot::robot_name_
protected

Definition at line 184 of file load_test_robot.h.

◆ robot_state_

robot_state::RobotStatePtr ompl_interface_testing::LoadTestRobot::robot_state_
protected

Definition at line 187 of file load_test_robot.h.


The documentation for this class was generated from the following file:


ompl
Author(s): Ioan Sucan
autogenerated on Tue Dec 24 2024 03:28:10