ros-industrial / ros2_canopen

CANopen driver framework for ROS2
https://ros-industrial.github.io/ros2_canopen/manual/rolling/
141 stars 60 forks source link

Add generic Controller for Canopen #54

Closed destogl closed 1 year ago

destogl commented 2 years ago

The controller enables sending of generic command to can open devices. It is not intended for the end-use, but for prototyping and debugging.

livanov93 commented 1 year ago

@destogl @ipa-cmh Please test 4d7a6a7 with:

colcon test --packages-select canopen_ros2_controllers --event-handlers desktop_notification+ status+ summary- console_direct+ terminal_title+ --ctest-args -R test_canopen_proxy_controller 

and

colcon test --packages-select canopen_ros2_controllers --event-handlers desktop_notification+ status+ summary- console_direct+ terminal_title+ --ctest-args -R test_load_canopen_proxy_controller 
hellantos commented 1 year ago

For the first one I get the following result - 1 test failed:

colcon test --packages-select canopen_ros2_controllers --event-handlers desktop_notification+ status+ summary- console_direct+ terminal_title+ --ctest-args -R test_canopen_proxy_controller 
Starting >>> canopen_ros2_controllers
UpdateCTestConfiguration  from :/home/christoph/ws_ros2/build/canopen_ros2_controllers/CTestConfiguration.ini
Parse Config file:/home/christoph/ws_ros2/build/canopen_ros2_controllers/CTestConfiguration.ini
   Site: christoph-ThinkPad-T490
   Build name: (empty)
 Add coverage exclude regular expressions.
Create new tag: 20220920-1357 - Experimental
UpdateCTestConfiguration  from :/home/christoph/ws_ros2/build/canopen_ros2_controllers/CTestConfiguration.ini
Parse Config file:/home/christoph/ws_ros2/build/canopen_ros2_controllers/CTestConfiguration.ini
Test project /home/christoph/ws_ros2/build/canopen_ros2_controllers
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 2
    Start 2: test_canopen_proxy_controller

2: Test command: /usr/bin/python3.10 "-u" "/opt/ros/humble/share/ament_cmake_test/cmake/run_test.py" "/home/christoph/ws_ros2/build/canopen_ros2_controllers/test_results/canopen_ros2_controllers/test_canopen_proxy_controller.gtest.xml" "--package-name" "canopen_ros2_controllers" "--output-file" "/home/christoph/ws_ros2/build/canopen_ros2_controllers/ament_cmake_gmock/test_canopen_proxy_controller.txt" "--command" "/home/christoph/ws_ros2/build/canopen_ros2_controllers/test_canopen_proxy_controller" "--gtest_output=xml:/home/christoph/ws_ros2/build/canopen_ros2_controllers/test_results/canopen_ros2_controllers/test_canopen_proxy_controller.gtest.xml"
2: Test timeout computed to be: 60
2: -- run_test.py: invoking following command in '/home/christoph/ws_ros2/build/canopen_ros2_controllers':
2:  - /home/christoph/ws_ros2/build/canopen_ros2_controllers/test_canopen_proxy_controller --gtest_output=xml:/home/christoph/ws_ros2/build/canopen_ros2_controllers/test_results/canopen_ros2_controllers/test_canopen_proxy_controller.gtest.xml
2: Running main() from gmock_main.cc
2: [==========] Running 10 tests from 2 test suites.
2: [----------] Global test environment set-up.
2: [----------] 9 tests from CanopenProxyControllerTest
2: [ RUN      ] CanopenProxyControllerTest.joint_names_parameter_not_set
2: [ERROR] [1663682254.699946999] [test_canopen_ros2_controllers]: 'joint' parameter was empty
2: [       OK ] CanopenProxyControllerTest.joint_names_parameter_not_set (15 ms)
2: [ RUN      ] CanopenProxyControllerTest.all_parameters_set_configure_success
2: [INFO] [1663682254.711912406] [test_canopen_ros2_controllers]: configure successful
2: [       OK ] CanopenProxyControllerTest.all_parameters_set_configure_success (14 ms)
2: [ RUN      ] CanopenProxyControllerTest.check_exported_intefaces
2: [INFO] [1663682254.724553535] [test_canopen_ros2_controllers]: configure successful
2: [       OK ] CanopenProxyControllerTest.check_exported_intefaces (12 ms)
2: [ RUN      ] CanopenProxyControllerTest.activate_success
2: [INFO] [1663682254.737476876] [test_canopen_ros2_controllers]: configure successful
2: [       OK ] CanopenProxyControllerTest.activate_success (14 ms)
2: [ RUN      ] CanopenProxyControllerTest.update_success
2: [INFO] [1663682254.751703158] [test_canopen_ros2_controllers]: configure successful
2: [       OK ] CanopenProxyControllerTest.update_success (13 ms)
2: [ RUN      ] CanopenProxyControllerTest.deactivate_success
2: [INFO] [1663682254.764671982] [test_canopen_ros2_controllers]: configure successful
2: [       OK ] CanopenProxyControllerTest.deactivate_success (13 ms)
2: [ RUN      ] CanopenProxyControllerTest.reactivate_success
2: [INFO] [1663682254.777885047] [test_canopen_ros2_controllers]: configure successful
2: [       OK ] CanopenProxyControllerTest.reactivate_success (14 ms)
2: [ RUN      ] CanopenProxyControllerTest.test_setting_slow_mode_service
2: [INFO] [1663682254.792046905] [test_canopen_ros2_controllers]: configure successful
2: [       OK ] CanopenProxyControllerTest.test_setting_slow_mode_service (13 ms)
2: [ RUN      ] CanopenProxyControllerTest.test_update_logic_fast
2: [INFO] [1663682254.804379992] [test_canopen_ros2_controllers]: configure successful
2: [       OK ] CanopenProxyControllerTest.test_update_logic_fast (12 ms)
2: [----------] 9 tests from CanopenProxyControllerTest (121 ms total)
2: 
2: [----------] 1 test from MissingMandatoryParameterDuringConfiguration/CanopenProxyControllerTestParameterizedParameters
2: [ RUN      ] MissingMandatoryParameterDuringConfiguration/CanopenProxyControllerTestParameterizedParameters.one_parameter_is_missing/0
2: [ERROR] [1663682254.823898670] [test_canopen_ros2_controllers]: 'joint' parameter was empty
2: [       OK ] MissingMandatoryParameterDuringConfiguration/CanopenProxyControllerTestParameterizedParameters.one_parameter_is_missing/0 (11 ms)
2: [----------] 1 test from MissingMandatoryParameterDuringConfiguration/CanopenProxyControllerTestParameterizedParameters (11 ms total)
2: 
2: [----------] Global test environment tear-down
2: [==========] 10 tests from 2 test suites ran. (145 ms total)
2: [  PASSED  ] 10 tests.
2: -- run_test.py: return code 0                       
2: -- run_test.py: inject classname prefix into gtest result file '/home/christoph/ws_ros2/build/canopen_ros2_controllers/test_results/canopen_ros2_controllers/test_canopen_proxy_controller.gtest.xml'
2: -- run_test.py: verify result file '/home/christoph/ws_ros2/build/canopen_ros2_controllers/test_results/canopen_ros2_controllers/test_canopen_proxy_controller.gtest.xml'
1/1 Test #2: test_canopen_proxy_controller ....   Passed    0.33 sec

The following tests passed:
    test_canopen_proxy_controller

100% tests passed, 0 tests failed out of 1

Label Time Summary:
gmock    =   0.33 sec*proc (1 test)

Total Test time (real) =   0.34 sec
Finished <<< canopen_ros2_controllers [0.40s]          

Second on:

colcon test --packages-select canopen_ros2_controllers --event-handlers desktop_notification+ status+ summary- console_direct+ terminal_title+ --ctest-args -R test_load_canopen_proxy_controller 
Starting >>> canopen_ros2_controllers
UpdateCTestConfiguration  from :/home/christoph/ws_ros2/build/canopen_ros2_controllers/CTestConfiguration.ini
Parse Config file:/home/christoph/ws_ros2/build/canopen_ros2_controllers/CTestConfiguration.ini
   Site: christoph-ThinkPad-T490
   Build name: (empty)
 Add coverage exclude regular expressions.
Create new tag: 20220920-1357 - Experimental
UpdateCTestConfiguration  from :/home/christoph/ws_ros2/build/canopen_ros2_controllers/CTestConfiguration.ini
Parse Config file:/home/christoph/ws_ros2/build/canopen_ros2_controllers/CTestConfiguration.ini
Test project /home/christoph/ws_ros2/build/canopen_ros2_controllers
Constructing a list of tests
Done constructing a list of tests
Updating test list for fixtures
Added 0 tests to meet fixture requirements
Checking test dependency graph...
Checking test dependency graph end
test 1
    Start 1: test_load_canopen_proxy_controller

1: Test command: /usr/bin/python3.10 "-u" "/opt/ros/humble/share/ament_cmake_test/cmake/run_test.py" "/home/christoph/ws_ros2/build/canopen_ros2_controllers/test_results/canopen_ros2_controllers/test_load_canopen_proxy_controller.gtest.xml" "--package-name" "canopen_ros2_controllers" "--output-file" "/home/christoph/ws_ros2/build/canopen_ros2_controllers/ament_cmake_gmock/test_load_canopen_proxy_controller.txt" "--command" "/home/christoph/ws_ros2/build/canopen_ros2_controllers/test_load_canopen_proxy_controller" "--gtest_output=xml:/home/christoph/ws_ros2/build/canopen_ros2_controllers/test_results/canopen_ros2_controllers/test_load_canopen_proxy_controller.gtest.xml"
1: Test timeout computed to be: 60
1: -- run_test.py: invoking following command in '/home/christoph/ws_ros2/build/canopen_ros2_controllers':
1:  - /home/christoph/ws_ros2/build/canopen_ros2_controllers/test_load_canopen_proxy_controller --gtest_output=xml:/home/christoph/ws_ros2/build/canopen_ros2_controllers/test_results/canopen_ros2_controllers/test_load_canopen_proxy_controller.gtest.xml
1: Running main() from gmock_main.cc
1: [==========] Running 1 test from 1 test suite.
1: [----------] Global test environment set-up.
1: [----------] 1 test from TestLoadCanopenProxyController
1: [ RUN      ] TestLoadCanopenProxyController.load_controller
1: [INFO] [1663682236.161395986] [resource_manager]: Loading hardware 'TestActuatorHardware' 
1: [INFO] [1663682236.162179674] [resource_manager]: Initialize hardware 'TestActuatorHardware' 
1: [INFO] [1663682236.162194392] [resource_manager]: Successful initialization of hardware 'TestActuatorHardware'
1: [INFO] [1663682236.162203586] [resource_manager]: Loading hardware 'TestSensorHardware' 
1: [INFO] [1663682236.162315872] [resource_manager]: Initialize hardware 'TestSensorHardware' 
1: [INFO] [1663682236.162323729] [resource_manager]: Successful initialization of hardware 'TestSensorHardware'
1: [INFO] [1663682236.162327828] [resource_manager]: Loading hardware 'TestSystemHardware' 
1: [INFO] [1663682236.162466599] [resource_manager]: Initialize hardware 'TestSystemHardware' 
1: [INFO] [1663682236.162482388] [resource_manager]: Successful initialization of hardware 'TestSystemHardware'
1: [INFO] [1663682236.175082874] [test_controller_manager]: Loading controller 'test_canopen_ros2_controllers'
1: [       OK ] TestLoadCanopenProxyController.load_controller (28 ms)
1: [----------] 1 test from TestLoadCanopenProxyController (28 ms total)
1: 
1: [----------] Global test environment tear-down
1: [==========] 1 test from 1 test suite ran. (28 ms total)
1: [  PASSED  ] 1 test.
1: -- run_test.py: return code 0                       
1: -- run_test.py: inject classname prefix into gtest result file '/home/christoph/ws_ros2/build/canopen_ros2_controllers/test_results/canopen_ros2_controllers/test_load_canopen_proxy_controller.gtest.xml'
1: -- run_test.py: verify result file '/home/christoph/ws_ros2/build/canopen_ros2_controllers/test_results/canopen_ros2_controllers/test_load_canopen_proxy_controller.gtest.xml'
1/1 Test #1: test_load_canopen_proxy_controller ...   Passed    0.22 sec

The following tests passed:
    test_load_canopen_proxy_controller

100% tests passed, 0 tests failed out of 1

Label Time Summary:
gmock    =   0.22 sec*proc (1 test)

Total Test time (real) =   0.22 sec
Finished <<< canopen_ros2_controllers [0.29s]
livanov93 commented 1 year ago

100% tests passed, 0 tests failed out of 1

@ipa-cmh I can see for both of them 100% tests passed, 0 tests failed out of 1. Am I right?

hellantos commented 1 year ago

@livanov93 sorry, only saw error and jumped to conclusions :D

livanov93 commented 1 year ago

@destogl ready for merge

hellantos commented 1 year ago

@destogl is merging okay, then I'll proceed.