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

Add header to import limits from standard URDF definition #1298

Merged

Conversation

saikishor
Copy link
Member

@saikishor saikishor commented Jan 15, 2024

Add a helper header similar to the one of ROS1 : https://github.com/ros-controls/ros_control/blob/noetic-devel/joint_limits_interface/include/joint_limits_interface/joint_limits_urdf.h to import limits from the standard URDF model (no limits from ros2_control tag are retrieved)

I will parse these first and later in another upcoming PR, I will be parsing the limits from the ros2_control tag within the hardware_interface package

Copy link

codecov bot commented Jan 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (3309c6d) 48.02% compared to head (e2bf4ce) 48.02%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1298   +/-   ##
=======================================
  Coverage   48.02%   48.02%           
=======================================
  Files          41       41           
  Lines        3525     3525           
  Branches     1912     1912           
=======================================
  Hits         1693     1693           
  Misses        442      442           
  Partials     1390     1390           
Flag Coverage Δ
unittests 48.02% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@saikishor
Copy link
Member Author

The failed test seems to be the spawner_unspawner_test from the controller_manager, and it has nothing to do with PR

    [ RUN      ] TestLoadController.spawner_test_type_in_param
    [WARN] [1705338080.796966528] [test_controller_manager]: 'update_rate' parameter not set, using default value.
    [INFO] [1705338080.797378297] [test_controller_manager]: Subscribing to '/test_controller_manager/robot_description' topic for robot description.
    [INFO] [1705338080.797444630] [test_controller_manager]: Received robot description from topic.
    [INFO] [1705338080.797629435] [resource_manager]: Loading hardware 'TestActuatorHardware' 
    [INFO] [1705338080.798542048] [resource_manager]: Initialize hardware 'TestActuatorHardware' 
    [INFO] [1705338080.798712716] [resource_manager]: Successful initialization of hardware 'TestActuatorHardware'
    [INFO] [1705338080.798879688] [resource_manager]: Loading hardware 'TestSensorHardware' 
    [INFO] [1705338080.799084660] [resource_manager]: Initialize hardware 'TestSensorHardware' 
    [INFO] [1705338080.799134904] [resource_manager]: Successful initialization of hardware 'TestSensorHardware'
    [INFO] [1705338080.799165211] [resource_manager]: Loading hardware 'TestSystemHardware' 
    [INFO] [1705338080.799315351] [resource_manager]: Initialize hardware 'TestSystemHardware' 
    [INFO] [1705338080.799348893] [resource_manager]: Successful initialization of hardware 'TestSystemHardware'
    [INFO] [1705338080.799456784] [resource_manager]: 'configure' hardware 'TestSystemHardware' 
    [INFO] [1705338080.799474588] [resource_manager]: Successful 'configure' of hardware 'TestSystemHardware'
    [INFO] [1705338080.799490417] [resource_manager]: 'activate' hardware 'TestSystemHardware' 
    [INFO] [1705338080.799497881] [resource_manager]: Successful 'activate' of hardware 'TestSystemHardware'
    [INFO] [1705338080.799512198] [resource_manager]: 'configure' hardware 'TestSensorHardware' 
    [INFO] [1705338080.799519411] [resource_manager]: Successful 'configure' of hardware 'TestSensorHardware'
    [INFO] [1705338080.799527797] [resource_manager]: 'activate' hardware 'TestSensorHardware' 
    [INFO] [1705338080.799533648] [resource_manager]: Successful 'activate' of hardware 'TestSensorHardware'
    [INFO] [1705338080.799543727] [resource_manager]: 'configure' hardware 'TestActuatorHardware' 
    [INFO] [1705338080.799550329] [resource_manager]: Successful 'configure' of hardware 'TestActuatorHardware'
    [INFO] [1705338080.799561079] [resource_manager]: 'activate' hardware 'TestActuatorHardware' 
    [INFO] [1705338080.799567190] [resource_manager]: Successful 'activate' of hardware 'TestActuatorHardware'
    [INFO] [1705338081.514385291] [test_controller_manager]: Loading controller 'ctrl_1'
    [INFO] [1705338081.548206615] [spawner_ctrl_1]: [NON-XML-CHAR-0x1B][94mLoaded [NON-XML-CHAR-0x1B][1mctrl_1[NON-XML-CHAR-0x1B][0m
    [INFO] [1705338081.549248422] [test_controller_manager]: Configuring controller 'ctrl_1'
    [INFO] [1705338081.566170350] [spawner_ctrl_1]: [NON-XML-CHAR-0x1B][92mConfigured and activated [NON-XML-CHAR-0x1B][1mctrl_1[NON-XML-CHAR-0x1B][0m
    [WARN] [1705338082.061765117] [spawner_ctrl_1]: [NON-XML-CHAR-0x1B][93mController already loaded, skipping load_controller[NON-XML-CHAR-0x1B][0m
    [INFO] [1705338082.062589451] [test_controller_manager]: Configuring controller 'ctrl_1'
Error: ROR] [1705338082.062665934] [test_controller_manager]: Controller 'ctrl_1' can not be configured from 'active' state.
Error: ROR] [1705338082.063424384] [spawner_ctrl_1]: [NON-XML-CHAR-0x1B][91mFailed to configure controller[NON-XML-CHAR-0x1B][0m
    [ros2run]: Process exited with failure 1
    [WARN] [1705338082.567358039] [spawner_ctrl_1]: [NON-XML-CHAR-0x1B][93mController already loaded, skipping load_controller[NON-XML-CHAR-0x1B][0m
    [INFO] [1705338082.568251702] [test_controller_manager]: Configuring controller 'ctrl_1'
    terminate called without an active exception
    Stack trace (most recent call last) in thread 21001:
    #31   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5b0e54f, in std::thread::_Invoker<std::tuple<void (std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>::*)(), std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>*> >::operator()()
    #30   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5b0e87a, in void std::thread::_Invoker<std::tuple<void (std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>::*)(), std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>*> >::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>)
    #29   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5b0eb42, in std::__invoke_result<void (std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>::*)(), std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>*>::type std::__invoke<void (std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>::*)(), std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>*>(void (std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>::*&&)(), std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>*&&)
    #28   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5b0ecca, in void std::__invoke_impl<void, void (std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>::*)(), std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>*>(std::__invoke_memfun_deref, void (std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>::*&&)(), std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>*&&)
    #27   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5b0b7b9, in std::__future_base::_Async_state_impl<std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>::_M_run()
    #26   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5afb02a, in std::__future_base::_State_baseV2::_M_set_result(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>, bool)
    #25   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5afd85c, in void std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)
    #24   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5af0905, in __gthread_once(int*, void (*)())
    #23   Object "/usr/lib/x86_64-linux-gnu/libc.so.6", at 0x7ff2f69fbee7, in 
    #22   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5b00871, in std::once_flag::_Prepare_execution::_Prepare_execution<std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::{lambda()#1}>(void (std::__future_base::_State_baseV2::*&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*))::{lambda()#1}::_FUN()
    #21   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5b0085c, in std::once_flag::_Prepare_execution::_Prepare_execution<std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::{lambda()#1}>(void (std::__future_base::_State_baseV2::*&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*))::{lambda()#1}::operator()() const
    #20   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5afd7d7, in std::call_once<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::once_flag&, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)::{lambda()#1}::operator()() const
    #19   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5b0082c, in std::__invoke_result<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>::type std::__invoke<void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)
    #18   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5b0331e, in void std::__invoke_impl<void, void (std::__future_base::_State_baseV2::*)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*>(std::__invoke_memfun_deref, void (std::__future_base::_State_baseV2::*&&)(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*), std::__future_base::_State_baseV2*&&, std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*&&, bool*&&)
    #17   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5afb257, in std::__future_base::_State_baseV2::_M_do_set(std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>*, bool*)
    #16   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5afda49, in std::function<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> ()>::operator()() const
    #15   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5b0c16d, in std::_Function_handler<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> (), std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void> >::_M_invoke(std::_Any_data const&)
    #14   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5b0c374, in std::enable_if<is_invocable_r_v<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>, std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>&>, std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter> >::type std::__invoke_r<std::unique_ptr<std::__future_base::_Result_base, std::__future_base::_Result_base::_Deleter>, std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>&>(std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>&)
    #13   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5b0c54a, in std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter> std::__invoke_impl<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>&>(std::__invoke_other, std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>&)
    #12   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5b0c647, in std::__future_base::_Task_setter<std::unique_ptr<std::__future_base::_Result<void>, std::__future_base::_Result_base::_Deleter>, std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >, void>::operator()() const
    #11   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5b0c819, in std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >::operator()()
    #10   Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5b0c877, in void std::thread::_Invoker<std::tuple<TestLoadController::SetUp()::{lambda()#2}> >::_M_invoke<0ul>(std::_Index_tuple<0ul>)
    #9    Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5b0c8d6, in std::__invoke_result<TestLoadController::SetUp()::{lambda()#2}>::type std::__invoke<TestLoadController::SetUp()::{lambda()#2}>(TestLoadController::SetUp()::{lambda()#2}&&)
    #8    Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5b0c91b, in void std::__invoke_impl<void, TestLoadController::SetUp()::{lambda()#2}>(std::__invoke_other, TestLoadController::SetUp()::{lambda()#2}&&)
    #7    Object "/home/runner/work/ros2_control/ros2_control/.work/target_ws/build/controller_manager/test_spawner_unspawner", at 0x5631e5afc1c7, in TestLoadController::SetUp()::{lambda()#2}::operator()() const
    #6    Object "/opt/ros/rolling/lib/librclcpp.so", at 0x7ff2f6ec87b3, in rclcpp::executors::MultiThreadedExecutor::spin()
    #5    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7ff2f6c39276, in std::terminate()
    #4    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7ff2f6c3920b, in 
    #3    Object "/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.30", at 0x7ff2f6c2db9d, in 
    #2    Object "/usr/lib/x86_64-linux-gnu/libc.so.6", at 0x7ff2f698a7f2, in abort
    #1    Object "/usr/lib/x86_64-linux-gnu/libc.so.6", at 0x7ff2f69a4475, in raise
    #0    Object "/usr/lib/x86_64-linux-gnu/libc.so.6", at 0x7ff2f69f89fc, in pthread_kill
    Aborted (Signal sent by tkill() 20906 0)
  >>>
build/controller_manager/test_results/controller_manager/test_spawner_unspawner.gtest.xml: 1 test, 1 error, 0 failures, 0 skipped
- controller_manager test_spawner_unspawner.gtest.missing_result
  <<< error message
    The test
    ``` 
    
</details>

@saikishor
Copy link
Member Author

If it's fine, can we get this PR merged?
Most likely, this won't affect other packages as this is completely a new header.

@bmagyar bmagyar merged commit f3ffb56 into ros-controls:master Jan 23, 2024
13 checks passed
@saikishor saikishor added backport-humble This label should be used by maintaines only! Label triggers PR backport to ROS2 humble. backport-iron This label should be used by maintaines only! Label triggers PR backport to ROS2 Iron. labels Feb 26, 2024
mergify bot pushed a commit that referenced this pull request Feb 26, 2024
(cherry picked from commit f3ffb56)

# Conflicts:
#	joint_limits/CMakeLists.txt
mergify bot pushed a commit that referenced this pull request Feb 26, 2024
@saikishor saikishor deleted the add_header_to_parse_urdf_limits branch August 17, 2024 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-humble This label should be used by maintaines only! Label triggers PR backport to ROS2 humble. backport-iron This label should be used by maintaines only! Label triggers PR backport to ROS2 Iron.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants