forked from b-it-bots/mas_industrial_robotics
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request b-it-bots#294 from vamsikalagaturu/noetic
[mir_gripper_controller] openrb controller support for ros
- Loading branch information
Showing
7 changed files
with
56 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
# gripper_control | ||
Repository containing code for Teensy microcontroller and ROS interface for transferring gripper commands and feedback data. The software is designed in a way to prevent occurence of the overcurrent in the Dynamixels and enable slippage detection. | ||
# Gripper controller | ||
Package containing code to control two finger gripper with Dynamixel 12A motors and OpenRB-150 controller. | ||
|
||
More details on the controller and corresponding code can be found [here](https://github.com/b-it-bots/youbot_dynamixel_gripper_controller). | ||
|
||
> Note: Please make sure to follow all the steps and setup the Dynamixel correctly as described in the above link. | ||
## Requirements | ||
* python3 | ||
* ROS Noetic | ||
* pySerial | ||
|
||
## Getting started | ||
1. Download [Arduino IDE](https://www.arduino.cc/en/software) (do not use Ubuntu software manager!). | ||
2. Download Teensy plugin for Arduino IDE [here](https://www.pjrc.com/teensy/teensyduino.html). | ||
3. Download libraries for Arduino IDE: Dynamixel2Arduino, CircularBuffer, Arduino_JSON, this is done in the Arduino IDE (Tools->Manage Libraries). | ||
4. Open file `control_with_comm.ino` in the `teensy/src` directory, compile it and upload on the microcontroller. | ||
1. Make sure to uplaod the latest [code](https://github.com/b-it-bots/youbot_dynamixel_gripper_controller/tree/master/openrb_150_controller) on to the controller. | ||
5. Run `roscore` command. | ||
5. Run `gripper_controller.py` in the `ros/src` directory. | ||
6. To control the gripper publish to the `/arm_1/gripper_command` topic, e.g. `rostopic pub /arm_1/gripper_command std_msgs/String "data: '0'"` | ||
5. Run `dynamixel_gripper_controller_ros` in the `ros/scripts` directory. | ||
6. To control the gripper publish to the `/arm_1/gripper_command` topic, e.g. `rostopic pub /arm_1/gripper_command std_msgs/String "command: 0.0"` | ||
7. To see the state of the gripper subscribe to the `/arm_1/gripper_feedback`, e.g. `rostopic echo /arm_1/gripper_feedback`. | ||
|
||
## Setting up the Dynamixel | ||
- Please follow the guide [here](https://emanual.robotis.com/docs/en/parts/interface/usb2dynamixel/). | ||
- For setting the baudrate install [here](https://emanual.robotis.com/docs/en/software/dynamixel/dynamixel_wizard2/). | ||
|
||
## Usage | ||
* One can publish 0 (open) or 1 (close) command to the gripper. | ||
* One can subscribe the state of the gripper, the format consists of the following fields: `state` (`GRIPPER_CLOSE`, `OBJECT_GRASPED`, `OBJECT_SLIPPED`, `GRIPPER_OPEN`), `parsing_error` (0 - false, 1 - true), `last_command` (0, 1). | ||
* One can publish `0.0 (open)` or `1.0 (close)` command to the gripper. | ||
* For more specific position control, one can publish a value between `0.0 and 1.0`. | ||
* To further open the gripper, one can publish a value between `-1.5 and 0.0`. | ||
* One can subscribe the state of the gripper, the format consists of the following fields: `state` (`GRIPPER_CLOSE`, `OBJECT_GRASPED`, `OBJECT_SLIPPED`, `GRIPPER_OPEN`, `GRIPPER_INTER`), `parsing_error` (0 - false, 1 - true), `last_command` (0, 1). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
mir_manipulation/mir_manipulation_msgs/msg/GripperCommand.msg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
float32 command | ||
|
||
float32 OPEN = 0.0 | ||
float32 CLOSE = 1.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters