Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steering controller time related test fixes #13

Merged
merged 5 commits into from
May 22, 2023
Merged

Steering controller time related test fixes #13

merged 5 commits into from
May 22, 2023

Conversation

ARK3r
Copy link

@ARK3r ARK3r commented May 19, 2023

It seems there was a time comparison happening in the background and the two time objects were not on the same clock:

    [ RUN      ] TricycleSteeringControllerTest.reactivate_success
    [INFO] [1682530561.566980203] [test_tricycle_steering_controller]: tricycle odom configure successful
    [INFO] [1682530561.568943417] [test_tricycle_steering_controller]: configure successful
    unknown file: Failure
    C++ exception with description "can't subtract times with different time sources [2 != 1]" thrown in the test body.
    [  FAILED  ] TricycleSteeringControllerTest.reactivate_success (14 ms)

changed the clocks to be RCL_ROS_TIME and it resolved most of the problems except for the receive_message_and_publish_updated_status tests in each of the following 3 packages:

  • Ackermann_steering_controller
  • Tricycle_steering_controller
  • Bicycle_steering_controller

@ARK3r
Copy link
Author

ARK3r commented May 22, 2023

Although changing the time objects to be in RCL_ROS_TIME doesn't fix the problem for the receive_message_and_publish_updated_status functions, I think it still adds a little bit of value since it shows this possible solution has been tested.

@ARK3r
Copy link
Author

ARK3r commented May 22, 2023

These changes are inspired by the diff_drive_controller tests on the main branch so I don't think these are band-aid fixes, I think they are resolving the actual problem.

@ARK3r
Copy link
Author

ARK3r commented May 22, 2023

this is the output I'm getting now:

root@a39237ac34b6:/ros2_ws# colcon test-result --verbose
build/ackermann_steering_controller/Testing/20230522-1704/Test.xml: 3 tests, 0 errors, 1 failure, 0 skipped
- test_load_ackermann_steering_controller
  <<< failure message
    -- run_test.py: invoking following command in '/ros2_ws/build/ackermann_steering_controller':
     - /ros2_ws/build/ackermann_steering_controller/test_load_ackermann_steering_controller --gtest_output=xml:/ros2_ws/build/ackermann_steering_controller/test_results/ackermann_steering_controller/test_load_ackermann_steering_controller.gtest.xml
    Running main() from gmock_main.cc
    [==========] Running 1 test from 1 test suite.
    [----------] Global test environment set-up.
    [----------] 1 test from TestLoadAckermannSteeringController
    [ RUN      ] TestLoadAckermannSteeringController.load_controller
    [INFO] [1684775076.187188187] [resource_manager]: Loading hardware 'TestActuatorHardware' 
    [INFO] [1684775076.188455273] [resource_manager]: Initialize hardware 'TestActuatorHardware' 
    [INFO] [1684775076.188545375] [resource_manager]: Successful initialization of hardware 'TestActuatorHardware'
    [INFO] [1684775076.188701427] [resource_manager]: Loading hardware 'TestSensorHardware' 
    [INFO] [1684775076.189271501] [resource_manager]: Initialize hardware 'TestSensorHardware' 
    [INFO] [1684775076.189301254] [resource_manager]: Successful initialization of hardware 'TestSensorHardware'
    [INFO] [1684775076.189311585] [resource_manager]: Loading hardware 'TestSystemHardware' 
    [INFO] [1684775076.189866005] [resource_manager]: Initialize hardware 'TestSystemHardware' 
    [INFO] [1684775076.189881419] [resource_manager]: Successful initialization of hardware 'TestSystemHardware'
    [WARN] [1684775076.208367111] [test_controller_manager]: 'update_rate' parameter not set, using default value.
    [INFO] [1684775076.212596670] [test_controller_manager]: Loading controller 'test_ackermann_steering_controller'
    Exception thrown during controller's init with message: parameter 'rear_wheels_names' is not initialized 
    [ERROR] [1684775076.219489502] [test_controller_manager]: Could not initialize the controller named 'test_ackermann_steering_controller'
    /ros2_ws/src/ros2_controllers/ackermann_steering_controller/test/test_load_ackermann_steering_controller.cpp:37: Failure
    Expected: (cm.load_controller( "test_ackermann_steering_controller", "ackermann_steering_controller/AckermannSteeringController")) != (nullptr), actual: 16-byte object <00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00> vs (nullptr)
    [  FAILED  ] TestLoadAckermannSteeringController.load_controller (53 ms)
    [----------] 1 test from TestLoadAckermannSteeringController (53 ms total)
    
    [----------] Global test environment tear-down
    [==========] 1 test from 1 test suite ran. (53 ms total)
    [  PASSED  ] 0 tests.
    [  FAILED  ] 1 test, listed below:
    [  FAILED  ] TestLoadAckermannSteeringController.load_controller
    
     1 FAILED TEST
    -- run_test.py: return code 1
    -- run_test.py: inject classname prefix into gtest result file '/ros2_ws/build/ackermann_steering_controller/test_results/ackermann_steering_controller/test_load_ackermann_steering_controller.gtest.xml'
    -- run_test.py: verify result file '/ros2_ws/build/ackermann_steering_controller/test_results/ackermann_steering_controller/test_load_ackermann_steering_controller.gtest.xml'
  >>>
build/ackermann_steering_controller/test_results/ackermann_steering_controller/test_load_ackermann_steering_controller.gtest.xml: 1 test, 0 errors, 1 failure, 0 skipped
- ackermann_steering_controller.TestLoadAckermannSteeringController load_controller
  <<< failure message
    /ros2_ws/src/ros2_controllers/ackermann_steering_controller/test/test_load_ackermann_steering_controller.cpp:37
    Expected: (cm.load_controller( "test_ackermann_steering_controller", "ackermann_steering_controller/AckermannSteeringController")) != (nullptr), actual: 16-byte object <00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00> vs (nullptr)
  >>>
build/bicycle_steering_controller/Testing/20230522-1704/Test.xml: 3 tests, 0 errors, 1 failure, 0 skipped
- test_load_bicycle_steering_controller
  <<< failure message
    -- run_test.py: invoking following command in '/ros2_ws/build/bicycle_steering_controller':
     - /ros2_ws/build/bicycle_steering_controller/test_load_bicycle_steering_controller --gtest_output=xml:/ros2_ws/build/bicycle_steering_controller/test_results/bicycle_steering_controller/test_load_bicycle_steering_controller.gtest.xml
    Running main() from gmock_main.cc
    [==========] Running 1 test from 1 test suite.
    [----------] Global test environment set-up.
    [----------] 1 test from TestLoadBicycleSteeringController
    [ RUN      ] TestLoadBicycleSteeringController.load_controller
    [INFO] [1684775076.201545587] [resource_manager]: Loading hardware 'TestActuatorHardware' 
    [INFO] [1684775076.202822456] [resource_manager]: Initialize hardware 'TestActuatorHardware' 
    [INFO] [1684775076.202910339] [resource_manager]: Successful initialization of hardware 'TestActuatorHardware'
    [INFO] [1684775076.203063773] [resource_manager]: Loading hardware 'TestSensorHardware' 
    [INFO] [1684775076.203690898] [resource_manager]: Initialize hardware 'TestSensorHardware' 
    [INFO] [1684775076.203720022] [resource_manager]: Successful initialization of hardware 'TestSensorHardware'
    [INFO] [1684775076.203730413] [resource_manager]: Loading hardware 'TestSystemHardware' 
    [INFO] [1684775076.204263417] [resource_manager]: Initialize hardware 'TestSystemHardware' 
    [INFO] [1684775076.204278602] [resource_manager]: Successful initialization of hardware 'TestSystemHardware'
    [WARN] [1684775076.222342262] [test_controller_manager]: 'update_rate' parameter not set, using default value.
    [INFO] [1684775076.227019676] [test_controller_manager]: Loading controller 'test_bicycle_steering_controller'
    Exception thrown during controller's init with message: parameter 'rear_wheels_names' is not initialized 
    [ERROR] [1684775076.233512338] [test_controller_manager]: Could not initialize the controller named 'test_bicycle_steering_controller'
    /ros2_ws/src/ros2_controllers/bicycle_steering_controller/test/test_load_bicycle_steering_controller.cpp:37: Failure
    Expected: (cm.load_controller( "test_bicycle_steering_controller", "bicycle_steering_controller/BicycleSteeringController")) != (nullptr), actual: 16-byte object <00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00> vs (nullptr)
    [  FAILED  ] TestLoadBicycleSteeringController.load_controller (50 ms)
    [----------] 1 test from TestLoadBicycleSteeringController (50 ms total)
    
    [----------] Global test environment tear-down
    [==========] 1 test from 1 test suite ran. (50 ms total)
    [  PASSED  ] 0 tests.
    [  FAILED  ] 1 test, listed below:
    [  FAILED  ] TestLoadBicycleSteeringController.load_controller
    
     1 FAILED TEST
    -- run_test.py: return code 1
    -- run_test.py: inject classname prefix into gtest result file '/ros2_ws/build/bicycle_steering_controller/test_results/bicycle_steering_controller/test_load_bicycle_steering_controller.gtest.xml'
    -- run_test.py: verify result file '/ros2_ws/build/bicycle_steering_controller/test_results/bicycle_steering_controller/test_load_bicycle_steering_controller.gtest.xml'
  >>>
build/bicycle_steering_controller/test_results/bicycle_steering_controller/test_load_bicycle_steering_controller.gtest.xml: 1 test, 0 errors, 1 failure, 0 skipped
- bicycle_steering_controller.TestLoadBicycleSteeringController load_controller
  <<< failure message
    /ros2_ws/src/ros2_controllers/bicycle_steering_controller/test/test_load_bicycle_steering_controller.cpp:37
    Expected: (cm.load_controller( "test_bicycle_steering_controller", "bicycle_steering_controller/BicycleSteeringController")) != (nullptr), actual: 16-byte object <00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00> vs (nullptr)
  >>>
build/tricycle_steering_controller/Testing/20230522-1704/Test.xml: 3 tests, 0 errors, 1 failure, 0 skipped
- test_load_tricycle_steering_controller
  <<< failure message
    -- run_test.py: invoking following command in '/ros2_ws/build/tricycle_steering_controller':
     - /ros2_ws/build/tricycle_steering_controller/test_load_tricycle_steering_controller --gtest_output=xml:/ros2_ws/build/tricycle_steering_controller/test_results/tricycle_steering_controller/test_load_tricycle_steering_controller.gtest.xml
    Running main() from gmock_main.cc
    [==========] Running 1 test from 1 test suite.
    [----------] Global test environment set-up.
    [----------] 1 test from TestLoadTricycleSteeringController
    [ RUN      ] TestLoadTricycleSteeringController.load_controller
    [INFO] [1684775076.231517487] [resource_manager]: Loading hardware 'TestActuatorHardware' 
    [INFO] [1684775076.232724834] [resource_manager]: Initialize hardware 'TestActuatorHardware' 
    [INFO] [1684775076.232812518] [resource_manager]: Successful initialization of hardware 'TestActuatorHardware'
    [INFO] [1684775076.232968316] [resource_manager]: Loading hardware 'TestSensorHardware' 
    [INFO] [1684775076.233523258] [resource_manager]: Initialize hardware 'TestSensorHardware' 
    [INFO] [1684775076.233554546] [resource_manager]: Successful initialization of hardware 'TestSensorHardware'
    [INFO] [1684775076.233565958] [resource_manager]: Loading hardware 'TestSystemHardware' 
    [INFO] [1684775076.234085454] [resource_manager]: Initialize hardware 'TestSystemHardware' 
    [INFO] [1684775076.234099826] [resource_manager]: Successful initialization of hardware 'TestSystemHardware'
    [WARN] [1684775076.250967558] [test_controller_manager]: 'update_rate' parameter not set, using default value.
    [INFO] [1684775076.254801385] [test_controller_manager]: Loading controller 'test_tricycle_steering_controller'
    Exception thrown during controller's init with message: parameter 'rear_wheels_names' is not initialized 
    [ERROR] [1684775076.261003754] [test_controller_manager]: Could not initialize the controller named 'test_tricycle_steering_controller'
    /ros2_ws/src/ros2_controllers/tricycle_steering_controller/test/test_load_tricycle_steering_controller.cpp:37: Failure
    Expected: (cm.load_controller( "test_tricycle_steering_controller", "tricycle_steering_controller/TricycleSteeringController")) != (nullptr), actual: 16-byte object <00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00> vs (nullptr)
    [  FAILED  ] TestLoadTricycleSteeringController.load_controller (48 ms)
    [----------] 1 test from TestLoadTricycleSteeringController (48 ms total)
    
    [----------] Global test environment tear-down
    [==========] 1 test from 1 test suite ran. (48 ms total)
    [  PASSED  ] 0 tests.
    [  FAILED  ] 1 test, listed below:
    [  FAILED  ] TestLoadTricycleSteeringController.load_controller
    
     1 FAILED TEST
    -- run_test.py: return code 1
    -- run_test.py: inject classname prefix into gtest result file '/ros2_ws/build/tricycle_steering_controller/test_results/tricycle_steering_controller/test_load_tricycle_steering_controller.gtest.xml'
    -- run_test.py: verify result file '/ros2_ws/build/tricycle_steering_controller/test_results/tricycle_steering_controller/test_load_tricycle_steering_controller.gtest.xml'
  >>>
build/tricycle_steering_controller/test_results/tricycle_steering_controller/test_load_tricycle_steering_controller.gtest.xml: 1 test, 0 errors, 1 failure, 0 skipped
- tricycle_steering_controller.TestLoadTricycleSteeringController load_controller
  <<< failure message
    /ros2_ws/src/ros2_controllers/tricycle_steering_controller/test/test_load_tricycle_steering_controller.cpp:37
    Expected: (cm.load_controller( "test_tricycle_steering_controller", "tricycle_steering_controller/TricycleSteeringController")) != (nullptr), actual: 16-byte object <00-00 00-00 00-00 00-00 00-00 00-00 00-00 00-00> vs (nullptr)
  >>>

Summary: 49 tests, 0 errors, 6 failures, 0 skipped

as opposed to all the time related issues in this ci (I did get those errors before in my build and I don't anymore)

@bmagyar
Copy link

bmagyar commented May 22, 2023

This is great, thank you!!

@bmagyar bmagyar merged commit b9bdf63 into StoglRobotics-forks:ackermann-odometry-library May 22, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants