PickNikRobotics / ros2_robotiq_gripper

BSD 3-Clause "New" or "Revised" License
50 stars 40 forks source link

Refactor driver library to follow patterns from PickNikRobotics/ros2_epick_gripper #34

Closed kineticsystem closed 10 months ago

kineticsystem commented 1 year ago

The monolithic code has been broken apart to introduce tests.

The serial connection creation has been moved from the driver constructor to the hardware interface configure method.

A lot of code has been refactored with the intention of bringing the Epick gripper into this same repository and reusing some common code.

codecov[bot] commented 1 year ago

Codecov Report

Merging #34 (f5d7b7a) into main (743d20f) will increase coverage by 20.77%. Report is 6 commits behind head on main. The diff coverage is 21.34%.

:exclamation: Current head f5d7b7a differs from pull request most recent head 4c3fd18. Consider uploading reports for the commit 4c3fd18 to get more accurate results

@@            Coverage Diff             @@
##            main      #34       +/-   ##
==========================================
+ Coverage   0.00%   20.77%   +20.77%     
==========================================
  Files          5       20       +15     
  Lines        352      597      +245     
  Branches       0      240      +240     
==========================================
+ Hits           0      124      +124     
+ Misses       352      341       -11     
- Partials       0      132      +132     
Flag Coverage Δ
unittests 20.77% <21.34%> (+20.77%) :arrow_up:

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

Files Coverage Δ
.../include/robotiq_driver/default_driver_factory.hpp 100.00% <100.00%> (ø)
.../include/robotiq_driver/default_serial_factory.hpp 100.00% <100.00%> (ø)
robotiq_driver/include/robotiq_driver/serial.hpp 100.00% <100.00%> (ø)
robotiq_driver/src/crc_utils.cpp 100.00% <100.00%> (ø)
.../tests/test_robotiq_gripper_hardware_interface.cpp 33.33% <33.33%> (ø)
robotiq_driver/tests/mock/mock_driver.hpp 40.00% <40.00%> (ø)
robotiq_driver/tests/test_crc_utils.cpp 14.28% <14.28%> (ø)
robotiq_driver/tests/test_data_utils.cpp 45.45% <45.45%> (ø)
...driver/include/robotiq_driver/driver_exception.hpp 0.00% <0.00%> (ø)
robotiq_driver/tests/mock/mock_serial.hpp 0.00% <0.00%> (ø)
... and 10 more

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more

moriarty commented 1 year ago

From the logs it looks like the test assets were installed, but that file still not found..

https://github.com/PickNikRobotics/ros2_robotiq_gripper/actions/runs/6084786368/job/16507440934

2023-09-05T12:51:27.9022317Z executing command [apt-get install -y -qq ros-rolling-ament-cmake-copyright]
2023-09-05T12:51:27.9022908Z executing command [apt-get install -y -qq ros-rolling-ament-cmake-lint-cmake]
2023-09-05T12:51:27.9023473Z executing command [apt-get install -y -qq ros-rolling-ament-cmake-gmock]
2023-09-05T12:51:27.9024043Z executing command [apt-get install -y -qq ros-rolling-ros2-control-test-assets]
2023-09-05T12:51:27.9024623Z Setting up ros-rolling-ros2-control-test-assets (3.16.0-1jammy.20230711.194957) ...
2023-09-05T12:51:27.9025474Z executing command [apt-get install -y -qq ros-rolling-gripper-controllers]
2023-09-05T12:51:27.9025954Z Setting up python3-typeguard (2.2.2-1.1) ...
2023-09-05T12:51:27.9026404Z Setting up ros-rolling-tl-expected (1.0.2-3jammy.20230711.195032) ...
2023-09-05T12:51:27.9026836Z Setting up python3-markupsafe (2.0.1-2build1) ...
2023-09-05T12:51:27.9027224Z Setting up python3-tz (2022.1-1ubuntu0.22.04.1) ...
2023-09-05T12:51:27.9027645Z Setting up python-babel-localedata (2.8.0+dfsg.1-7) ...
2023-09-05T12:51:27.9028097Z Setting up ros-rolling-tcb-span (1.0.2-3jammy.20230711.195007) ...
2023-09-05T12:51:27.9028578Z Setting up ros-rolling-realtime-tools (2.5.0-2jammy.20230711.230518) ...
2023-09-05T12:51:27.9029006Z Setting up libelf-dev:amd64 (0.186-1build1) ...
2023-09-05T12:51:27.9029374Z Setting up liblzma-dev:amd64 (5.2.5-2ubuntu1) ...
2023-09-05T12:51:27.9029756Z Setting up python3-babel (2.8.0+dfsg.1-7) ...
2023-09-05T12:51:27.9030202Z Setting up ros-rolling-control-toolbox (3.1.0-1jammy.20230711.231139) ...
2023-09-05T12:51:27.9030620Z Setting up libdw-dev:amd64 (0.186-1build1) ...
2023-09-05T12:51:40.8430488Z Setting up ros-rolling-rsl (0.2.2-1jammy.20230711.232011) ...
2023-09-05T12:51:40.8430952Z Setting up python3-jinja2 (3.0.3-1) ...
2023-09-05T12:51:40.8441174Z Setting up ros-rolling-parameter-traits (0.3.3-1jammy.20230711.232510) ...
2023-09-05T12:51:40.8442021Z Setting up ros-rolling-backward-ros (1.0.2-4jammy.20230711.194802) ...
2023-09-05T12:51:40.8442572Z Setting up ros-rolling-generate-parameter-library-py (0.3.3-1jammy.20230711.194824) ...
2023-09-05T12:51:40.8443177Z Setting up ros-rolling-generate-parameter-library (0.3.3-1jammy.20230711.232811) ...
2023-09-05T12:51:40.8443734Z Setting up ros-rolling-gripper-controllers (3.12.0-1jammy.20230718.185445) ...
2023-09-05T12:51:40.8444330Z executing command [apt-get install -y -qq ros-rolling-joint-state-broadcaster]
2023-09-05T12:51:40.8444912Z Setting up ros-rolling-joint-state-broadcaster (3.12.0-1jammy.20230718.185413) ...
2023-09-05T12:51:40.8445798Z ##[endgroup]
2023-09-05T12:51:40.8446214Z 'install_target_dependencies' returned with code '0' after 2 min 3 sec
2023-09-05T12:51:40.8446586Z 
2023-09-05T12:51:40.8448241Z ##[group]build_target_workspace
2023-09-05T12:51:40.8448434Z 
2023-09-05T12:51:40.8449251Z $ ( source /home/runner/work/ros2_robotiq_gripper/ros2_robotiq_gripper/.work/upstream_ws/install/setup.bash && cd /home/runner/work/ros2_robotiq_gripper/ros2_robotiq_gripper/.work/target_ws && colcon build --event-handlers desktop_notification- status- terminal_title-; )
2023-09-05T12:51:40.8449890Z Starting >>> robotiq_controllers
2023-09-05T12:51:40.8450174Z Starting >>> robotiq_description
2023-09-05T12:51:40.8450476Z Finished <<< robotiq_description [0.81s]
2023-09-05T12:51:40.8454764Z Starting >>> robotiq_driver
2023-09-05T12:51:40.8455270Z Finished <<< robotiq_controllers [2.93s]
2023-09-05T12:51:40.8455640Z --- stderr: robotiq_driver
2023-09-05T12:51:40.8456545Z /home/runner/work/ros2_robotiq_gripper/ros2_robotiq_gripper/.work/target_ws/src/ros2_robotiq_gripper/robotiq_driver/tests/test_robotiq_gripper_hardware_interface.cpp:41:10: fatal error: ros2_control_test_assets/components_urdfs.hpp: No such file or directory
2023-09-05T12:51:40.8457502Z    41 | #include <ros2_control_test_assets/components_urdfs.hpp>
2023-09-05T12:51:40.8457956Z       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~