Classes | Functions | Variables
speed_observer_test Namespace Reference

Classes

class  SpeedObserverIntegrationTest
 
class  SpeedObserverUnitTest
 

Functions

 MATCHER_P (RunPermittedState, x,"RunPermitted state "+std::string(negation?"is not":"is")+": "+PrintToString(x)+".")
 
 MATCHER_P (ContainsAllNames, names,"Names"+PrintToString(names)+std::string(negation?"are not":"are")+" in message.")
 
 MATCHER_P2 (NameAtI, i, name,"Name at index "+PrintToString(i)+std::string(negation?"is not":"is")+": "+name+".")
 
 MATCHER_P2 (SpeedAtIGe, i, x,"Speed at index "+PrintToString(i)+std::string(negation?"is not":"is")+" greater or equal to"+PrintToString(x)+".")
 
 MATCHER_P2 (SpeedAtILe, i, x,"Speed at index "+PrintToString(i)+std::string(negation?"is not":"is")+" less or equal to"+PrintToString(x)+".")
 
 TEST_F (SpeedObserverUnitTest, testStartupAndTopic)
 
 TEST_F (SpeedObserverUnitTest, testTooHighSpeed)
 
 TEST_F (SpeedObserverIntegrationTest, testOperationModeT1)
 Tests speed observer with operation mode T1. More...
 
 TEST_F (SpeedObserverUnitTest, testSetSpeedLimit)
 
 TEST_F (SpeedObserverIntegrationTest, testOperationModeAuto)
 Tests speed observer with operation mode AUTO. More...
 
 TEST_F (SpeedObserverUnitTest, testTimeout)
 
 TEST_F (SpeedObserverIntegrationTest, testAdditionalTFTree)
 Tests speed observer with additional tf tree. More...
 
 TEST_F (SpeedObserverUnitTest, testFailingRunPermittedServiceCase)
 
 TEST_F (SpeedObserverUnitTest, testSlowTfPublishing)
 
 TEST_F (SpeedObserverIntegrationTest, testRunPermittedServiceNoSuccess)
 Tests speed observer with RUN_PERMITTED service returning no success. More...
 

Variables

static const std::string ADDITIONAL_FRAMES_PARAM_NAME { "additional_frames" }
 
static const std::string BARRIER_FAST { "BARRIER_FAST" }
 
static const std::string BARRIER_LIMIT { "BARRIER_LIMIT" }
 
static const std::string BARRIER_LIMIT_LOW { "BARRIER_LIMIT_LOW" }
 
static const std::string BARRIER_NO_STOP_HAPPENED { "BARRIER_NO_STOP_HAPPENED" }
 
static const std::string BARRIER_NO_SVC_SUCESS { "BARRIER_NO_SVC_SUCESS" }
 
static const std::string BARRIER_SLOW { "BARRIER_SLOW" }
 
static const std::string BARRIER_STOP_HAPPENED { "BARRIER_STOP_HAPPENED" }
 
static const std::string BARRIER_WAIT_OUT_STOP { "BARRIER_WAIT_OUT_STOP" }
 
static const std::string FAKE_CONTROLLER_JOINT_STATES_TOPIC_NAME { "/fake_controller_joint_states" }
 
static const std::string FRAME_SPEEDS_TOPIC_NAME { "/frame_speeds" }
 
static const std::string FRAME_SPEEDS_TOPIC_NAME { "/frame_speeds" }
 
static constexpr double OBSERVER_FREQUENCY {3.0 * TEST_FREQUENCY}
 
static const std::string OPERATION_MODE_TOPIC { "operation_mode" }
 
static const std::string RUN_PERMITTED_SERVICE { "run_permitted" }
 
static const std::string RUN_PERMITTED_SERVICE_NAME { "/run_permitted" }
 
static const std::string SPEED_LIMIT_AUTOMATIC_PARAM_NAME { "speed_limit_automatic" }
 
static const std::string SPEED_LIMIT_T1_PARAM_NAME { "speed_limit_t1" }
 
static const double SQRT_2_HALF { 1 / sqrt(2) }
 
static const double SQRT_2_HALF { 1 / sqrt(2) }
 
static const std::string TEST_BASE_FRAME { "test_base" }
 
static const std::string TEST_FRAME_A { "a" }
 
static const std::string TEST_FRAME_B { "b" }
 
static constexpr double TEST_FREQUENCY { 20 }
 
static const double TEST_FREQUENCY { 10 }
 
static const std::string TEST_WORLD_FRAME { "world" }
 

Function Documentation

speed_observer_test::MATCHER_P ( RunPermittedState  ,
,
"RunPermitted state "+std::string(negation?"is not":"is")+": "+PrintToString(x)+"."   
)
speed_observer_test::MATCHER_P ( ContainsAllNames  ,
names  ,
"Names"+PrintToString(names)+std::string(negation?"are not":"are")+" in message."   
)
speed_observer_test::MATCHER_P2 ( NameAtI  ,
,
name  ,
"Name at index "+PrintToString(i)+std::string(negation?"is not":"is")+": "+name+"."   
)

Definition at line 141 of file unittest_speed_observer.cpp.

speed_observer_test::MATCHER_P2 ( SpeedAtIGe  ,
,
,
"Speed at index "+PrintToString(i)+std::string(negation?"is not":"is")+" greater or equal to"+PrintToString(x)+"."   
)

Definition at line 147 of file unittest_speed_observer.cpp.

speed_observer_test::MATCHER_P2 ( SpeedAtILe  ,
,
,
"Speed at index "+PrintToString(i)+std::string(negation?"is not":"is")+" less or equal to"+PrintToString(x)+"."   
)

Definition at line 154 of file unittest_speed_observer.cpp.

speed_observer_test::TEST_F ( SpeedObserverUnitTest  ,
testStartupAndTopic   
)
  • Tests the correct observation of frames and handling of slow speeds. (Spec)

Test Sequence:

  1. Publish tf movements that are within the speed limit
  2. Start speed observing

Expected Results:

  1. -
  2. Correct values are published on the speed topic. No stop is published

Definition at line 175 of file unittest_speed_observer.cpp.

speed_observer_test::TEST_F ( SpeedObserverUnitTest  ,
testTooHighSpeed   
)
  • Tests the correct handling of too high speeds. (Spec)
  • Tests that Stop 1 is triggered if speed limit is violated. (Spec)

Test Sequence:

  1. Publish tf movements that have a too high speed
  2. Start speed observing

Expected Results:

  1. -
  2. Correct values are publshed on the speed topic. A stop is published

Definition at line 235 of file unittest_speed_observer.cpp.

speed_observer_test::TEST_F ( SpeedObserverIntegrationTest  ,
testOperationModeT1   
)

Tests speed observer with operation mode T1.

  • Tests that robot model is read correctly by providing a custom xacro. (Spec)
  • Tests that user defined frames are monitored correctly. (Spec)
  • Tests that Stop 1 is triggered if speed limit is violated. (Spec)
  • Tests the existence of the right limits by setting the mode and moving in speeds belowe and above the expected limit. (Spec)

Test Sequence:

  1. Publish Operation Mode T1.
  2. Joint motion with a speed higher than the T1 limit is faked.

Expected Results:

  1. RunPermitted is not triggered
  2. RunPermitted is triggered

Definition at line 253 of file integrationtest_speed_observer_and_operation_mode.cpp.

speed_observer_test::TEST_F ( SpeedObserverUnitTest  ,
testSetSpeedLimit   
)
  • Tests the correct handling of changed speed limits. (Spec)
  • Test that speed limits can be changed. (Spec)
  • Tests that Stop 1 is triggered if after changing the speed limit. (Spec)

Test Sequence:

  1. Publish tf movements with speed of 0.3,
  1. Start observer, set speed limit to 0.4
  2. Reduce speed limit to 0.2

Expected Results:

  1. -
  2. Correct values are published on the speed topic. No stop is called
  3. A stop is called

Definition at line 305 of file unittest_speed_observer.cpp.

speed_observer_test::TEST_F ( SpeedObserverIntegrationTest  ,
testOperationModeAuto   
)

Tests speed observer with operation mode AUTO.

  • Tests that robot model is read correctly by providing a custom xacro. (Spec)
  • Tests that user defined frames are monitored correctly. (Spec)
  • Tests that Stop 1 is triggered if speed limit is violated. (Spec)
  • Tests the existence of the right limits by setting the mode and moving in speeds belowe and above the expected limit. (Spec)

Test Sequence:

  1. Publish Operation Mode AUTO.
  2. Joint motion with a speed lower than the Auto limit is faked.
  3. Publish Operation Mode T1.

Expected Results:

  1. RunPermitted is not triggered
  2. RunPermitted is not triggered
  3. RunPermitted is triggered

Definition at line 324 of file integrationtest_speed_observer_and_operation_mode.cpp.

speed_observer_test::TEST_F ( SpeedObserverUnitTest  ,
testTimeout   
)
  • Tests the correct handling of no tf. (Spec)
  • Tests the correct handling of no tf. (Spec)

Test Sequence:

  1. Start observer

Expected Results:

  1. observe method throws exception

Definition at line 385 of file unittest_speed_observer.cpp.

speed_observer_test::TEST_F ( SpeedObserverIntegrationTest  ,
testAdditionalTFTree   
)

Tests speed observer with additional tf tree.

  • Tests that robot model is read correctly by providing a custom xacro. (Spec)
  • Tests that user defined frames are monitored correctly. (Spec)
  • Tests that Stop 1 is triggered if speed limit is violated. (Spec)
  • Tests the existence of the right limits by setting the mode and moving in speeds belowe and above the expected limit. (Spec)

Test Sequence:

  1. Publish Operation Mode T1. Publish the additionally defined TF tree at speed.

Expected Results:

  1. RunPermitted is triggered

Definition at line 407 of file integrationtest_speed_observer_and_operation_mode.cpp.

speed_observer_test::TEST_F ( SpeedObserverUnitTest  ,
testFailingRunPermittedServiceCase   
)

Test case in which RUN_PERMITTED service call fails (needed for line coverage).

Test Sequence:

  1. Publish tf movements that have a too high speed
  2. Start speed observing

Expected Results:

  1. -
  2. RunPermitted service is called

Definition at line 409 of file unittest_speed_observer.cpp.

speed_observer_test::TEST_F ( SpeedObserverUnitTest  ,
testSlowTfPublishing   
)

Tests that Stop1 is triggered in case the frame speed calculation fails too often.

Test Sequence:

  1. Publish tf movements
  2. Start speed observing

Expected Results:

  1. -
  2. Stop is triggered

Definition at line 455 of file unittest_speed_observer.cpp.

speed_observer_test::TEST_F ( SpeedObserverIntegrationTest  ,
testRunPermittedServiceNoSuccess   
)

Tests speed observer with RUN_PERMITTED service returning no success.

  • Tests that robot model is read correctly by providing a custom xacro. (Spec)
  • Tests that user defined frames are monitored correctly. (Spec)
  • Tests that Stop 1 is triggered if speed limit is violated. (Spec)
  • Tests the existence of the right limits by setting the mode and moving in speeds belowe and above the expected limit. (Spec)

Test Sequence:

  1. Publish Operation Mode T1. Set up the RUN_PERMITTED service to return success = false.

Expected Results:

  1. RunPermitted is triggered and error message is produced

Definition at line 461 of file integrationtest_speed_observer_and_operation_mode.cpp.

Variable Documentation

const std::string speed_observer_test::ADDITIONAL_FRAMES_PARAM_NAME { "additional_frames" }
static
const std::string speed_observer_test::BARRIER_FAST { "BARRIER_FAST" }
static

Definition at line 46 of file unittest_speed_observer.cpp.

const std::string speed_observer_test::BARRIER_LIMIT { "BARRIER_LIMIT" }
static

Definition at line 47 of file unittest_speed_observer.cpp.

const std::string speed_observer_test::BARRIER_LIMIT_LOW { "BARRIER_LIMIT_LOW" }
static

Definition at line 48 of file unittest_speed_observer.cpp.

const std::string speed_observer_test::BARRIER_NO_STOP_HAPPENED { "BARRIER_NO_STOP_HAPPENED" }
static
const std::string speed_observer_test::BARRIER_NO_SVC_SUCESS { "BARRIER_NO_SVC_SUCESS" }
static
const std::string speed_observer_test::BARRIER_SLOW { "BARRIER_SLOW" }
static

Definition at line 45 of file unittest_speed_observer.cpp.

const std::string speed_observer_test::BARRIER_STOP_HAPPENED { "BARRIER_STOP_HAPPENED" }
static
const std::string speed_observer_test::BARRIER_WAIT_OUT_STOP { "BARRIER_WAIT_OUT_STOP" }
static
const std::string speed_observer_test::FAKE_CONTROLLER_JOINT_STATES_TOPIC_NAME { "/fake_controller_joint_states" }
static
const std::string speed_observer_test::FRAME_SPEEDS_TOPIC_NAME { "/frame_speeds" }
static
const std::string speed_observer_test::FRAME_SPEEDS_TOPIC_NAME { "/frame_speeds" }
static

Definition at line 50 of file unittest_speed_observer.cpp.

constexpr double speed_observer_test::OBSERVER_FREQUENCY {3.0 * TEST_FREQUENCY}
static

Definition at line 57 of file unittest_speed_observer.cpp.

const std::string speed_observer_test::OPERATION_MODE_TOPIC { "operation_mode" }
static
const std::string speed_observer_test::RUN_PERMITTED_SERVICE { "run_permitted" }
static
const std::string speed_observer_test::RUN_PERMITTED_SERVICE_NAME { "/run_permitted" }
static

Definition at line 51 of file unittest_speed_observer.cpp.

const std::string speed_observer_test::SPEED_LIMIT_AUTOMATIC_PARAM_NAME { "speed_limit_automatic" }
static
const std::string speed_observer_test::SPEED_LIMIT_T1_PARAM_NAME { "speed_limit_t1" }
static
const double speed_observer_test::SQRT_2_HALF { 1 / sqrt(2) }
static
const double speed_observer_test::SQRT_2_HALF { 1 / sqrt(2) }
static

Definition at line 58 of file unittest_speed_observer.cpp.

const std::string speed_observer_test::TEST_BASE_FRAME { "test_base" }
static

Definition at line 52 of file unittest_speed_observer.cpp.

const std::string speed_observer_test::TEST_FRAME_A { "a" }
static

Definition at line 53 of file unittest_speed_observer.cpp.

const std::string speed_observer_test::TEST_FRAME_B { "b" }
static

Definition at line 54 of file unittest_speed_observer.cpp.

constexpr double speed_observer_test::TEST_FREQUENCY { 20 }
static

Definition at line 55 of file unittest_speed_observer.cpp.

const double speed_observer_test::TEST_FREQUENCY { 10 }
static
const std::string speed_observer_test::TEST_WORLD_FRAME { "world" }
static


prbt_hardware_support
Author(s):
autogenerated on Tue Feb 2 2021 03:50:18