Skip to content

Commit 7f29719

Browse files
committed
add dh_gripper
1 parent e835442 commit 7f29719

File tree

97 files changed

+3114
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

97 files changed

+3114
-0
lines changed

dh_gripper_ros/README.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Gripper controller
2+
3+
### Description
4+
This is the control interface for the gripper.
5+
6+
7+
8+
------
9+
10+
11+
12+
------
13+
14+
15+
16+
### Installation
17+
18+
1. Make sure you have already installed and Configured Your [ROS](http://wiki.ros.org/ROS/Tutorials/InstallingandConfiguringROSEnvironment) Environment
19+
20+
2. Create and build a [catkin workspace](http://wiki.ros.org/catkin/workspaces): (you can skip this step , if you have already created it)
21+
22+
```
23+
$ mkdir -p ~/catkin_ws/src
24+
$ cd ~/catkin_ws/
25+
$ catkin_make
26+
```
27+
28+
4. Clone the whole directory( `dh_gripper_driver_ros` ) to your catkin's workspace src folder
29+
30+
5. Compile the code
31+
32+
```
33+
$ cd ~/catkin_ws/
34+
$ catkin_make
35+
```
36+
37+
6. Add the path including to the `ROS_PACKAGE_PATH` environment variable. Open `~/.bashrc` file and add at the end the following line.
38+
39+
```
40+
$ source ~/catkin_ws/devel/setup.bash
41+
```
42+
43+
------
44+
45+
46+
47+
### Instructions
48+
49+
1. ##### Connect all hardware and Turn on the power
50+
51+
2. ##### Modify launch file and Running controller
52+
53+
First , Modify the `dh_gripper.launch` file in according to the product model
54+
55+
```
56+
//gripperID default 1
57+
<arg name="GripperID" default="1"/>
58+
//gripper Model
59+
<arg name="GripperModel" default="PGE"/>
60+
//grippper USB Port Name
61+
<arg name="Connectport" default="/dev/ttyUSB0"/>
62+
//gripper Baudrate defalut : 115200
63+
<arg name="Baudrate" default="115200"/>
64+
```
65+
66+
Now , you can running controller
67+
68+
```
69+
$ roslaunch dh_gripper_driver dh_gripper.launch
70+
```
71+
72+
> If If it runs successfully , you will see the initialization of the gripper,and then auto close and open
73+
74+
3. ##### Disable test run ,and use topic
75+
76+
Modify the `dh_gripper.launch` file, and roslaunch `dh_gripper.launch`
77+
78+
```
79+
<arg name="test_run" default="false"/>
80+
```
81+
82+
use topic to control
83+
84+
```
85+
$rostopic pub /gripper/ctrl dh_gripper_msgs/GripperCtrl "initialize: false
86+
position: 0.0
87+
force: 100.0
88+
speed: 100.0"
89+
```
90+
91+
4. ##### Study how to use it
92+
93+
you can read the ` dh_gripper_Test.cpp` in `/dh_hand_driver/src` folder to study
94+
95+
5. ##### Enjoy it
96+
97+
98+
99+
### gazebo7
100+
$ sudo apt-get install ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-ros-control
101+
102+
```
103+
$ catkin_make
104+
105+
374 KB
Binary file not shown.
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"files.associations": {
3+
"array": "cpp",
4+
"string": "cpp"
5+
}
6+
}
Lines changed: 229 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,229 @@
1+
cmake_minimum_required(VERSION 2.8.3)
2+
project(dh_gripper_driver)
3+
4+
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -O3 -march=native ")
5+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -O3 -march=native")
6+
7+
# Check C++11 or C++0x support
8+
include(CheckCXXCompilerFlag)
9+
CHECK_CXX_COMPILER_FLAG("-std=c++11" COMPILER_SUPPORTS_CXX11)
10+
CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X)
11+
if(COMPILER_SUPPORTS_CXX11)
12+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
13+
add_definitions(-DCOMPILEDWITHC11)
14+
message(STATUS "Using flag -std=c++11.")
15+
elseif(COMPILER_SUPPORTS_CXX0X)
16+
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
17+
add_definitions(-DCOMPILEDWITHC0X)
18+
message(STATUS "Using flag -std=c++0x.")
19+
else()
20+
message(FATAL_ERROR "The compiler ${CMAKE_CXX_COMPILER} has no C++11 support. Please use a different C++ compiler.")
21+
endif()
22+
23+
24+
## System dependencies are found with CMake's conventions
25+
find_package(catkin REQUIRED COMPONENTS
26+
roscpp
27+
rospy
28+
std_msgs
29+
dh_gripper_msgs
30+
sensor_msgs
31+
)
32+
33+
## Uncomment this if the package has a setup.py. This macro ensures
34+
## modules and global scripts declared therein get installed
35+
## See http://ros.org/doc/api/catkin/html/user_guide/setup_dot_py.html
36+
# catkin_python_setup()
37+
38+
################################################
39+
## Declare ROS messages, services and actions ##
40+
################################################
41+
42+
## To declare and build messages, services or actions from within this
43+
## package, follow these steps:
44+
## * Let MSG_DEP_SET be the set of packages whose message types you use in
45+
## your messages/services/actions (e.g. std_msgs, actionlib_msgs, ...).
46+
## * In the file package.xml:
47+
## * add a build_depend tag for "message_generation"
48+
## * add a build_depend and a exec_depend tag for each package in MSG_DEP_SET
49+
## * If MSG_DEP_SET isn't empty the following dependency has been pulled in
50+
## but can be declared for certainty nonetheless:
51+
## * add a exec_depend tag for "message_runtime"
52+
## * In this file (CMakeLists.txt):
53+
## * add "message_generation" and every package in MSG_DEP_SET to
54+
## find_package(catkin REQUIRED COMPONENTS ...)
55+
## * add "message_runtime" and every package in MSG_DEP_SET to
56+
## catkin_package(CATKIN_DEPENDS ...)
57+
## * uncomment the add_*_files sections below as needed
58+
## and list every .msg/.srv/.action file to be processed
59+
## * uncomment the generate_messages entry below
60+
## * add every package in MSG_DEP_SET to generate_messages(DEPENDENCIES ...)
61+
62+
## Generate messages in the 'msg' folder
63+
# add_message_files(
64+
# FILES
65+
# Message1.msg
66+
# Message2.msg
67+
# )
68+
69+
## Generate services in the 'srv' folder
70+
# add_service_files(
71+
# FILES
72+
# Service1.srv
73+
# Service2.srv
74+
# )
75+
76+
## Generate actions in the 'action' folder
77+
# add_action_files(
78+
# FILES
79+
# Action1.action
80+
# Action2.action
81+
# )
82+
83+
## Generate added messages and services with any dependencies listed here
84+
# generate_messages(
85+
# DEPENDENCIES
86+
# std_msgs
87+
# )
88+
89+
################################################
90+
## Declare ROS dynamic reconfigure parameters ##
91+
################################################
92+
93+
## To declare and build dynamic reconfigure parameters within this
94+
## package, follow these steps:
95+
## * In the file package.xml:
96+
## * add a build_depend and a exec_depend tag for "dynamic_reconfigure"
97+
## * In this file (CMakeLists.txt):
98+
## * add "dynamic_reconfigure" to
99+
## find_package(catkin REQUIRED COMPONENTS ...)
100+
## * uncomment the "generate_dynamic_reconfigure_options" section below
101+
## and list every .cfg file to be processed
102+
103+
## Generate dynamic reconfigure parameters in the 'cfg' folder
104+
# generate_dynamic_reconfigure_options(
105+
# cfg/DynReconf1.cfg
106+
# cfg/DynReconf2.cfg
107+
# )
108+
109+
###################################
110+
## catkin specific configuration ##
111+
###################################
112+
## The catkin_package macro generates cmake config files for your package
113+
## Declare things to be passed to dependent projects
114+
## INCLUDE_DIRS: uncomment this if your package contains header files
115+
## LIBRARIES: libraries you create in this project that dependent projects also need
116+
## CATKIN_DEPENDS: catkin_packages dependent projects also need
117+
## DEPENDS: system dependencies of this project that dependent projects also need
118+
catkin_package(
119+
INCLUDE_DIRS include
120+
CATKIN_DEPENDS
121+
roscpp
122+
rospy
123+
std_msgs
124+
)
125+
126+
###########
127+
## Build ##
128+
###########
129+
130+
## Specify additional locations of header files
131+
## Your package locations should be listed before other locations
132+
include_directories(
133+
${catkin_INCLUDE_DIRS}
134+
include
135+
include/dh_gripper_driver/include
136+
)
137+
138+
## Declare a C++ library
139+
# add_library(${PROJECT_NAME}
140+
# src/${PROJECT_NAME}/dh_gripper_driver.cpp
141+
# )
142+
143+
## Add cmake target dependencies of the library
144+
## as an example, code may need to be generated before libraries
145+
## either from message generation or dynamic reconfigure
146+
# add_dependencies(${PROJECT_NAME} ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
147+
148+
149+
## Declare a C++ executable
150+
## With catkin_make all packages are built within a single CMake context
151+
## The recommended prefix ensures that target names across packages don't collide
152+
# add_executable(${PROJECT_NAME}_node src/dh_gripper_driver_node.cpp)
153+
add_executable(dh_gripper_driver
154+
include/dh_gripper_driver/src/dh_device.cpp
155+
include/dh_gripper_driver/src/dh_ag95_can.cpp
156+
include/dh_gripper_driver/src/dh_dh3_can.cpp
157+
include/dh_gripper_driver/src/dh_lagacy_gripper.cpp
158+
include/dh_gripper_driver/src/dh_modbus_gripper.cpp
159+
include/dh_gripper_driver/src/dh_rgi.cpp
160+
src/dh_gripper_driver.cpp)
161+
162+
add_executable(dh_gripper_driver_test
163+
src/dh_gripper_Test.cpp)
164+
## Rename C++ executable without prefix
165+
## The above recommended prefix causes long target names, the following renames the
166+
## target back to the shorter version for ease of user use
167+
## e.g. "rosrun someones_pkg node" instead of "rosrun someones_pkg someones_pkg_node"
168+
# set_target_properties(${PROJECT_NAME}_node PROPERTIES OUTPUT_NAME node PREFIX "")
169+
170+
## Add cmake target dependencies of the executable
171+
## same as for the library above
172+
# add_dependencies(${PROJECT_NAME}_node ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
173+
174+
## Specify libraries to link a library or executable target against
175+
# target_link_libraries(${PROJECT_NAME}_node
176+
# ${catkin_LIBRARIES}
177+
# )
178+
179+
#############
180+
## Install ##
181+
#############
182+
183+
# all install targets should use catkin DESTINATION variables
184+
# See http://ros.org/doc/api/catkin/html/adv_user_guide/variables.html
185+
186+
## Mark executable scripts (Python etc.) for installation
187+
## in contrast to setup.py, you can choose the destination
188+
# install(PROGRAMS
189+
# scripts/my_python_script
190+
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
191+
# )
192+
193+
## Mark executables and/or libraries for installation
194+
# install(TARGETS ${PROJECT_NAME} ${PROJECT_NAME}_node
195+
# ARCHIVE DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
196+
# LIBRARY DESTINATION ${CATKIN_PACKAGE_LIB_DESTINATION}
197+
# RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
198+
# )
199+
200+
## Mark cpp header files for installation
201+
# install(DIRECTORY include/${PROJECT_NAME}/
202+
# DESTINATION ${CATKIN_PACKAGE_INCLUDE_DESTINATION}
203+
# FILES_MATCHING PATTERN "*.h"
204+
# PATTERN ".svn" EXCLUDE
205+
# )
206+
207+
## Mark other files for installation (e.g. launch and bag files, etc.)
208+
# install(FILES
209+
# # myfile1
210+
# # myfile2
211+
# DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
212+
# )
213+
214+
#############
215+
## Testing ##
216+
#############
217+
218+
## Add gtest based cpp test target and link libraries
219+
# catkin_add_gtest(${PROJECT_NAME}-test test/test_dh_gripper_driver.cpp)
220+
# if(TARGET ${PROJECT_NAME}-test)
221+
# target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME})
222+
# endif()
223+
target_link_libraries(dh_gripper_driver
224+
${catkin_LIBRARIES})
225+
226+
target_link_libraries(dh_gripper_driver_test
227+
${catkin_LIBRARIES})
228+
## Add folders to be run by python nosetests
229+
# catkin_add_nosetests(test)

dh_gripper_ros/dh_gripper_driver/build/.cmake/api/v1/query/client-integration-vscode/cache-v2

Whitespace-only changes.

dh_gripper_ros/dh_gripper_driver/build/.cmake/api/v1/query/client-integration-vscode/cmakeFiles-v1

Whitespace-only changes.

dh_gripper_ros/dh_gripper_driver/build/.cmake/api/v1/query/client-integration-vscode/codemodel-v2

Whitespace-only changes.

0 commit comments

Comments
 (0)