Skip to content

Commit 6edbf83

Browse files
authored
Initial ros2_control architecture (#1)
1 parent a5a884c commit 6edbf83

File tree

12 files changed

+675
-23
lines changed

12 files changed

+675
-23
lines changed

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# robotiq_hande_driver
2+
[![Licence](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
3+
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
24

3-
Package for controlling the [Robotiq Hand-E gripper](https://robotiq.com/products/adaptive-grippers#Hand-E) from the [ROS 2 Control](https://control.ros.org/humble/doc/getting_started/getting_started.html) framework.
5+
Package for controlling the [Robotiq Hand-E gripper](https://robotiq.com/products/adaptive-grippers#Hand-E) from the [ROS 2 Control](https://control.ros.org/humble/doc/getting_started/getting_started.html) framework. It uses the [robotiq_hande_description](https://github.com/macmacal/robotiq_hande_description) package for the URDF definitions.
46

57
Work is still in progress.
68

7-
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit)
89

910
---
1011

@@ -14,13 +15,14 @@ Work is still in progress.
1415
```bash
1516
cd ~/ceai_ws/src
1617
git clone git@github.com:AGH-CEAI/robotiq_hande_driver.git ./src
18+
vcs import src < src/robotiq_hande_driver/robotiq_hande_driver.repos &&
1719
colcon build --symlink-install --packages-select robotiq_hande_driver
1820
source ./install/local_setup.sh
1921
```
2022

21-
### Run
23+
### Launch preview
2224
```bash
23-
ros2 run robotiq_hande_driver hande_driver
25+
ros2 launch robotiq_hande_driver gripper_controller_preview.launch.py use_fake_hardware:=true
2426
```
2527

2628

Lines changed: 65 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,75 @@
1-
cmake_minimum_required(VERSION 3.8)
1+
cmake_minimum_required(VERSION 3.16)
22
project(robotiq_hande_driver)
33

4-
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
4+
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
55
add_compile_options(-Wall -Wextra -Wpedantic)
66
endif()
77

8+
set(HW_IF_INCLUDE_DEPENDS
9+
fmt
10+
hardware_interface
11+
pluginlib
12+
rclcpp
13+
rclcpp_lifecycle
14+
rcpputils
15+
)
16+
817
find_package(ament_cmake REQUIRED)
18+
foreach(Dependency IN ITEMS ${HW_IF_INCLUDE_DEPENDS})
19+
find_package(${Dependency} REQUIRED)
20+
endforeach()
21+
22+
add_library(${PROJECT_NAME}
23+
SHARED
24+
hardware/src/hande_hardware_interface.cpp
25+
)
26+
27+
target_compile_features(${PROJECT_NAME} PUBLIC cxx_std_17)
28+
target_include_directories(robotiq_hande_driver PUBLIC
29+
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/hardware/include>
30+
$<INSTALL_INTERFACE:include>
31+
)
32+
ament_target_dependencies(
33+
${PROJECT_NAME} PUBLIC
34+
${HW_IF_INCLUDE_DEPENDS}
35+
)
36+
37+
pluginlib_export_plugin_description_file(hardware_interface ros2_control_plugin.xml)
38+
39+
install(
40+
DIRECTORY hardware/include/
41+
DESTINATION include/
42+
)
43+
install(
44+
DIRECTORY bringup
45+
DESTINATION share/${PROJECT_NAME}
46+
)
947

10-
add_executable(hande_driver src/hande_driver.cpp)
11-
target_include_directories(hande_driver PUBLIC
12-
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
13-
$<INSTALL_INTERFACE:include>)
14-
target_compile_features(hande_driver PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17
1548

16-
install(TARGETS hande_driver
17-
DESTINATION lib/${PROJECT_NAME})
49+
install(TARGETS ${PROJECT_NAME}
50+
EXPORT export_${PROJECT_NAME}
51+
ARCHIVE DESTINATION lib
52+
LIBRARY DESTINATION lib
53+
RUNTIME DESTINATION bin
54+
)
55+
56+
if(BUILD_TESTING)
57+
find_package(ament_cmake_gmock REQUIRED)
58+
# find_package(ament_cmake_pytest REQUIRED)
59+
find_package(hardware_interface REQUIRED)
60+
61+
ament_add_gmock(test_load_hw_interface
62+
test/test_load_hw_interface.cpp
63+
)
64+
target_link_libraries(test_load_hw_interface ${PROJECT_NAME})
65+
66+
# TODO: investigate
67+
# ament_add_pytest_test(example_7_urdf_xacro test/test_urdf_xacro.py)
68+
# ament_add_pytest_test(view_example_7_launch test/test_view_robot_launch.py)
69+
# ament_add_pytest_test(run_example_7_launch test/test_r6bot_controller_launch.py)
70+
endif()
1871

72+
## EXPORTS
73+
ament_export_targets(export_${PROJECT_NAME} HAS_LIBRARY_TARGET)
74+
ament_export_dependencies(${HW_IF_INCLUDE_DEPENDS})
1975
ament_package()
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# This is an example configuration file for the controller_manager node.
2+
# YOU CAN NOT USE IT IN YOUR APPLICATION WITHOUT CHANGES
3+
/**:
4+
controller_manager:
5+
ros__parameters:
6+
update_rate: 10 # Hz
7+
8+
joint_state_broadcaster:
9+
type: joint_state_broadcaster/JointStateBroadcaster
10+
11+
gripper_action_controller:
12+
type: position_controllers/GripperActionController
13+
14+
gripper_action_controller:
15+
ros__parameters:
16+
action_monitor_rate: 20.0 # Hz
17+
joint: $(var tf_prefix)robotiq_hande_left_finger_joint
18+
max_effort: 10.0 # N
19+
goal_tolerance: 0.01 # m
20+
allow_stalling: false
21+
stall_velocity_threshold: 0.001 #m/s
22+
stall_timeout: 1.0 # s
23+
state_interfaces:
24+
- position
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
Panels:
2+
- Class: rviz_common/Displays
3+
Help Height: 78
4+
Name: Displays
5+
Property Tree Widget:
6+
Expanded:
7+
- /Global Options1
8+
- /Status1
9+
- /RobotModel1
10+
Splitter Ratio: 0.5
11+
Tree Height: 2233
12+
- Class: rviz_common/Selection
13+
Name: Selection
14+
- Class: rviz_common/Tool Properties
15+
Expanded:
16+
- /2D Goal Pose1
17+
- /Publish Point1
18+
Name: Tool Properties
19+
Splitter Ratio: 0.5886790156364441
20+
- Class: rviz_common/Views
21+
Expanded:
22+
- /Current View1
23+
Name: Views
24+
Splitter Ratio: 0.5
25+
- Class: rviz_common/Time
26+
Experimental: false
27+
Name: Time
28+
SyncMode: 0
29+
SyncSource: ""
30+
Visualization Manager:
31+
Class: ""
32+
Displays:
33+
- Alpha: 0.5
34+
Cell Size: 1
35+
Class: rviz_default_plugins/Grid
36+
Color: 160; 160; 164
37+
Enabled: true
38+
Line Style:
39+
Line Width: 0.029999999329447746
40+
Value: Lines
41+
Name: Grid
42+
Normal Cell Count: 0
43+
Offset:
44+
X: 0
45+
Y: 0
46+
Z: 0
47+
Plane: XY
48+
Plane Cell Count: 10
49+
Reference Frame: <Fixed Frame>
50+
Value: true
51+
- Alpha: 1
52+
Class: rviz_default_plugins/RobotModel
53+
Collision Enabled: false
54+
Description File: ""
55+
Description Source: Topic
56+
Description Topic:
57+
Depth: 5
58+
Durability Policy: Volatile
59+
History Policy: Keep Last
60+
Reliability Policy: Reliable
61+
Value: /robot_description
62+
Enabled: true
63+
Links:
64+
All Links Enabled: true
65+
Expand Joint Details: false
66+
Expand Link Details: false
67+
Expand Tree: false
68+
Link Tree Style: Links in Alphabetic Order
69+
robotiq_hande_coupler:
70+
Alpha: 1
71+
Show Axes: false
72+
Show Trail: false
73+
Value: true
74+
robotiq_hande_end:
75+
Alpha: 1
76+
Show Axes: false
77+
Show Trail: false
78+
robotiq_hande_left_finger:
79+
Alpha: 1
80+
Show Axes: false
81+
Show Trail: false
82+
Value: true
83+
robotiq_hande_link:
84+
Alpha: 1
85+
Show Axes: false
86+
Show Trail: false
87+
Value: true
88+
robotiq_hande_right_finger:
89+
Alpha: 1
90+
Show Axes: false
91+
Show Trail: false
92+
Value: true
93+
tool0:
94+
Alpha: 1
95+
Show Axes: false
96+
Show Trail: false
97+
Mass Properties:
98+
Inertia: false
99+
Mass: false
100+
Name: RobotModel
101+
TF Prefix: ""
102+
Update Interval: 0
103+
Value: true
104+
Visual Enabled: true
105+
Enabled: true
106+
Global Options:
107+
Background Color: 48; 48; 48
108+
Fixed Frame: tool0
109+
Frame Rate: 30
110+
Name: root
111+
Tools:
112+
- Class: rviz_default_plugins/Interact
113+
Hide Inactive Objects: true
114+
- Class: rviz_default_plugins/MoveCamera
115+
- Class: rviz_default_plugins/Select
116+
- Class: rviz_default_plugins/FocusCamera
117+
- Class: rviz_default_plugins/Measure
118+
Line color: 128; 128; 0
119+
- Class: rviz_default_plugins/SetInitialPose
120+
Covariance x: 0.25
121+
Covariance y: 0.25
122+
Covariance yaw: 0.06853891909122467
123+
Topic:
124+
Depth: 5
125+
Durability Policy: Volatile
126+
History Policy: Keep Last
127+
Reliability Policy: Reliable
128+
Value: /initialpose
129+
- Class: rviz_default_plugins/SetGoal
130+
Topic:
131+
Depth: 5
132+
Durability Policy: Volatile
133+
History Policy: Keep Last
134+
Reliability Policy: Reliable
135+
Value: /goal_pose
136+
- Class: rviz_default_plugins/PublishPoint
137+
Single click: true
138+
Topic:
139+
Depth: 5
140+
Durability Policy: Volatile
141+
History Policy: Keep Last
142+
Reliability Policy: Reliable
143+
Value: /clicked_point
144+
Transformation:
145+
Current:
146+
Class: rviz_default_plugins/TF
147+
Value: true
148+
Views:
149+
Current:
150+
Class: rviz_default_plugins/Orbit
151+
Distance: 0.5352108478546143
152+
Enable Stereo Rendering:
153+
Stereo Eye Separation: 0.05999999865889549
154+
Stereo Focal Distance: 1
155+
Swap Stereo Eyes: false
156+
Value: false
157+
Focal Point:
158+
X: 0
159+
Y: 0
160+
Z: 0
161+
Focal Shape Fixed Size: false
162+
Focal Shape Size: 0.05000000074505806
163+
Invert Z Axis: false
164+
Name: Current View
165+
Near Clip Distance: 0.009999999776482582
166+
Pitch: 0.46039843559265137
167+
Target Frame: <Fixed Frame>
168+
Value: Orbit (rviz)
169+
Yaw: 4.508580684661865
170+
Saved: ~
171+
Window Geometry:
172+
Displays:
173+
collapsed: false
174+
Height: 2531
175+
Hide Left Dock: false
176+
Hide Right Dock: true
177+
QMainWindow State: 000000ff00000000fd0000000400000000000001ac00000944fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005d00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003e00000944000000cb00fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000010f00000944fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000003e00000944000000a500fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000005a00000003efc0100000002fb0000000800540069006d00650100000000000005a00000027900fffffffb0000000800540069006d00650100000000000004500000000000000000000003ee0000094400000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
178+
Selection:
179+
collapsed: false
180+
Time:
181+
collapsed: false
182+
Tool Properties:
183+
collapsed: false
184+
Views:
185+
collapsed: true
186+
Width: 1440
187+
X: 0
188+
Y: 0

0 commit comments

Comments
 (0)