20 #define BOOST_TEST_STATIC_LINK 22 #include <boost/test/included/unit_test.hpp> 24 #include <robot_model_services/robot_model/impl/MILDRobotState.hpp> 38 void testString(std::string stringToTest, std::vector<std::string> occurrencesInString) {
39 for (
auto occurrence : occurrencesInString) {
40 BOOST_CHECK_MESSAGE(stringToTest.find(occurrence) != std::string::npos,
"attribute " + occurrence +
" not found");
48 robot_model_services::MILDRobotState mildRobotState = robot_model_services::MILDRobotState(1.0, 2.0, 3.0, 4.0, 5.0);
54 std::stringstream objectPointSs;
55 std::stringstream samplePointSs;
56 std::stringstream viewportPointSs;
57 std::stringstream mildRobotStateSs;
58 std::stringstream defaultScoreContainerSs;
60 objectPointSs << objectPoint;
61 samplePointSs << samplePoint;
62 viewportPointSs <<viewportPoint;
63 mildRobotStateSs << mildRobotState;
64 defaultScoreContainerSs << defaultScoreContainer;
66 std::string objectPointStr = objectPointSs.str();
67 std::string samplePointStr = samplePointSs.str();
68 std::string viewportPointStr = viewportPointSs.str();
69 std::string mildRobotStateStr = mildRobotStateSs.str();
70 std::string defaultScoreContainerStr = defaultScoreContainerSs.str();
72 std::vector<std::string> objectPointAttrs = {
76 "intermediate_object_weight:" 79 std::vector<std::string> samplePointAttrs = {
84 std::vector<std::string> viewportPointAttrs = {
91 std::vector<std::string> mildRobotStateAttrs = {
98 std::vector<std::string> defaultScoreContainerAttrs = {
99 "utilityNormalization: 42",
100 "unweightedInverseMovementCostsBaseRotation: 1.7",
102 "weightedInverseCosts:",
109 testString(viewportPointStr, viewportPointAttrs);
110 testString(mildRobotStateStr, mildRobotStateAttrs);
111 testString(defaultScoreContainerStr, defaultScoreContainerAttrs);
113 std::cout <<
"ObjectPoint: " << std::endl << objectPoint << std::endl;
114 std::cout <<
"SamplePoint: " << std::endl << samplePoint << std::endl;
115 std::cout <<
"ViewportPoint: " << std::endl << viewportPoint << std::endl;
116 std::cout <<
"MILDRobotState: " << std::endl << mildRobotState << std::endl;
117 std::cout <<
"DefaultScoreContainer: " << std::endl << defaultScoreContainer << std::endl;
125 test_suite* evaluation = BOOST_TEST_SUITE(
"Evaluation NBV");
131 framework::master_test_suite().add(evaluation);
void testString(std::string stringToTest, std::vector< std::string > occurrencesInString)
void setUnweightedInverseMovementCostsBaseRotation(float value)
sets the inverse movement costs for the base rotation
void setUtilityNormalization(float value)
sets the utility normalization
Eigen::Matrix< Precision, 3, 1 > SimpleVector3
SpaceSamplePoint SamplePoint
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
RealObjectPoint ObjectPoint
void setUnweightedUnnormalizedObjectUtilitiy(std::string objectType, float value)
sets the utilitiy for an object type
this namespace contains all generally usable classes.
DefaultScoreContainer implements the BaseScoreContainer base class.
DefaultViewportPoint ViewportPoint
test_suite * init_unit_test_suite(int argc, char *argv[])