質問編集履歴
1
プログラム修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -24,12 +24,6 @@
|
|
24
24
|
```
|
25
25
|
#!/usr/bin/env python3
|
26
26
|
|
27
|
-
"""@package docstring
|
28
|
-
ROS node for controling a Robotiq 2F gripper using the Modbus RTU protocol.
|
29
|
-
|
30
|
-
The script takes as an argument the IP address of the gripper. It initializes a baseRobotiq2FGripper object and adds a comModbusTcp client to it. It then loops forever, reading the gripper status and updating its command. The gripper status is published on the 'Robotiq2FGripperRobotInput' topic using the 'Robotiq2FGripper_robot_input' msg type. The node subscribes to the 'Robotiq2FGripperRobotOutput' topic for new commands using the 'Robotiq2FGripper_robot_output' msg type. Examples are provided to control the gripper (Robotiq2FGripperSimpleController.py) and interpreting its status (Robotiq2FGripperStatusListener.py).
|
31
|
-
"""
|
32
|
-
|
33
27
|
import roslib; roslib.load_manifest('robotiq_2f_gripper_control')
|
34
28
|
roslib.load_manifest('robotiq_modbus_rtu')
|
35
29
|
import rospy
|
@@ -83,13 +77,6 @@
|
|
83
77
|
|
84
78
|
#参照したノード(comModbusRtu.py)
|
85
79
|
```
|
86
|
-
|
87
|
-
"""@package docstring
|
88
|
-
Module comModbusRtu: defines a class which communicates with Robotiq Grippers using the Modbus RTU protocol.
|
89
|
-
|
90
|
-
The module depends on pymodbus (http://code.google.com/p/pymodbus/) for the Modbus RTU client.
|
91
|
-
"""
|
92
|
-
|
93
80
|
from __future__ import print_function
|
94
81
|
|
95
82
|
from pymodbus.client.sync import ModbusSerialClient
|
@@ -159,12 +146,6 @@
|
|
159
146
|
|
160
147
|
#参照したノード(baseRobotiq2FGripper.py)
|
161
148
|
```
|
162
|
-
"""@package docstring
|
163
|
-
Module baseRobotiq2FGripper: defines a base class for handling command and status of the Robotiq 2F gripper.
|
164
|
-
|
165
|
-
After being instanciated, a 'client' member must be added to the object. This client depends on the communication protocol used by the Gripper. As an example, the ROS node 'Robotiq2FGripperTcpNode.py' instanciate a robotiqbaseRobotiq2FGripper and adds a client defined in the module comModbusTcp.
|
166
|
-
"""
|
167
|
-
|
168
149
|
from robotiq_2f_gripper_control.msg import _Robotiq2FGripper_robot_input as inputMsg
|
169
150
|
from robotiq_2f_gripper_control.msg import _Robotiq2FGripper_robot_output as outputMsg
|
170
151
|
|