-
Notifications
You must be signed in to change notification settings - Fork 85
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 #140 from elephantrobotics/myhand_force_gripper
Myhand force gripper
- Loading branch information
Showing
217 changed files
with
48,921 additions
and
178 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
17 changes: 17 additions & 0 deletions
17
mycobot_320/new_mycobot_320/launch/adaptive_gripper.launch
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,17 @@ | ||
<launch> | ||
<arg name="model" default="$(find mycobot_description)/urdf/pro_adaptive_gripper/mycobot_pro_adaptive_gripper.urdf"/> | ||
<arg name="rvizconfig" default="$(find mycobot_description)/urdf/pro_adaptive_gripper/pro_adaptive_gripper.rviz" /> | ||
|
||
<arg name="gui" default="true" /> | ||
|
||
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" /> | ||
|
||
<!-- Combinejoin values to TF --> | ||
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" /> | ||
<node name="joint_state_publisher_gui" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui"> | ||
<param name="use_gui" value="$(arg gui)" /> | ||
<!-- <rosparam param="source_list" subst_value="true">["joint_states"]</rosparam> --> | ||
</node> | ||
<!-- Show in Rviz ,显示在Rviz--> | ||
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" /> | ||
</launch> |
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,17 @@ | ||
<launch> | ||
<arg name="model" default="$(find mycobot_description)/urdf/force_control_gripper/mycobot_pro_force_gripper.urdf"/> | ||
<arg name="rvizconfig" default="$(find mycobot_description)/urdf/pro_adaptive_gripper/pro_adaptive_gripper.rviz" /> | ||
|
||
<arg name="gui" default="true" /> | ||
|
||
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" /> | ||
|
||
<!-- Combinejoin values to TF --> | ||
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" /> | ||
<node name="joint_state_publisher_gui" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui"> | ||
<param name="use_gui" value="$(arg gui)" /> | ||
<!-- <rosparam param="source_list" subst_value="true">["joint_states"]</rosparam> --> | ||
</node> | ||
<!-- Show in Rviz ,显示在Rviz--> | ||
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" /> | ||
</launch> |
20 changes: 20 additions & 0 deletions
20
mycobot_320/new_mycobot_320/launch/mycobot_320_force_gripper_slider.launch
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,20 @@ | ||
<launch> | ||
<arg name="port" default="/dev/ttyACM0" /> | ||
<arg name="baud" default="115200" /> | ||
|
||
<arg name="model" default="$(find mycobot_description)/urdf/mycobot_320_m5_2022/pro_320_m5_2022_force_gripper.urdf"/> | ||
<arg name="rvizconfig" default="$(find new_mycobot_320)/config/new_mycobot_320_gripper.rviz" /> | ||
<arg name="gui" default="true" /> | ||
|
||
<!-- new --> | ||
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" /> | ||
|
||
<!-- Combinejoin values to TF --> | ||
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" /> | ||
<node name="joint_state_publisher_gui" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui"> | ||
|
||
</node> | ||
|
||
<!-- Show in Rviz --> | ||
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" /> | ||
</launch> |
17 changes: 17 additions & 0 deletions
17
mycobot_320/new_mycobot_320/launch/mycobot_320_force_gripper_test.launch
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,17 @@ | ||
<launch> | ||
<arg name="model" default="$(find mycobot_description)/urdf/mycobot_320_m5_2022/pro_320_m5_2022_force_gripper.urdf"/> | ||
<arg name="rvizconfig" default="$(find new_mycobot_320)/config/new_mycobot_320_gripper.rviz" /> | ||
|
||
<arg name="gui" default="true" /> | ||
|
||
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" /> | ||
|
||
<!-- Combinejoin values to TF --> | ||
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" /> | ||
<node name="joint_state_publisher_gui" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui"> | ||
<param name="use_gui" value="$(arg gui)" /> | ||
<!-- <rosparam param="source_list" subst_value="true">["joint_states"]</rosparam> --> | ||
</node> | ||
<!-- Show in Rviz ,显示在Rviz--> | ||
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" /> | ||
</launch> |
17 changes: 3 additions & 14 deletions
17
mycobot_320/new_mycobot_320/launch/mycobot_320_gripper_slider.launch
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,31 +1,20 @@ | ||
<launch> | ||
<arg name="port" default="/dev/ttyUSB0" /> | ||
<arg name="port" default="/dev/ttyACM0" /> | ||
<arg name="baud" default="115200" /> | ||
|
||
<arg name="model" default="$(find mycobot_description)/urdf/mycobot_320_m5_2022/new_mycobot_pro_320_m5_2022_gripper.urdf"/> | ||
<arg name="rvizconfig" default="$(find new_mycobot_320)/config/new_mycobot_320_gripper.rviz" /> | ||
<arg name="gui" default="true" /> | ||
|
||
<!-- <include file="$(find mycobot_280)/launch/slider_control.launch"> | ||
<arg name="model" value="$(arg model)" /> | ||
<arg name="rvizconfig" value="$(arg rvizconfig)" /> | ||
<arg name="gui" value="$(arg gui)" /> | ||
</include> --> | ||
|
||
<!-- new --> | ||
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" /> | ||
|
||
<!-- Combinejoin values to TF --> | ||
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" /> | ||
<node name="joint_state_publisher_gui" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui"> | ||
<!-- <param name="use_gui" value="$(arg gui)" /> --> | ||
<!-- <rosparam param="source_list" subst_value="true">["joint_states"]</rosparam> --> | ||
|
||
</node> | ||
<!-- Open control script --> | ||
<!-- <node name="control_slider" pkg="mycobot_280" type="slider_control.py"> | ||
<param name="port" type="string" value="$(arg port)" /> | ||
<param name="baud" type="int" value="$(arg baud)" /> | ||
</node> --> | ||
|
||
<!-- Show in Rviz --> | ||
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" /> | ||
</launch> |
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,11 @@ | ||
<launch> | ||
<arg name="model" default="$(find mycobot_description)/urdf/three_gripper/mycobot_pro_three_gripper.urdf"/> | ||
<arg name="rvizconfig" default="$(find mycobot_description)/urdf/three_gripper/three_gripper.rviz" /> | ||
|
||
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" /> | ||
|
||
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" /> | ||
<!-- <node pkg="tf2_ros" type="static_transform_publisher" name="static_transform_publisher" args="0 0 0 0 0 0 world gripper_base"/> --> | ||
<!-- 使用 RViz 显示 --> | ||
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true"/> | ||
</launch> |
73 changes: 73 additions & 0 deletions
73
mycobot_320/new_mycobot_320/scripts/mycobot_320_force_gripper_slider.py
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,73 @@ | ||
#!/usr/bin/env python3 | ||
# -*- coding:utf-8 -*- | ||
"""[summary] | ||
This file obtains the joint angle of the manipulator in ROS, | ||
and then sends it directly to the real manipulator using `pymycobot` API. | ||
This file is [slider_control.launch] related script. | ||
Passable parameters: | ||
port: serial prot string. Defaults is '/dev/ttyUSB0' | ||
baud: serial prot baudrate. Defaults is 115200. | ||
""" | ||
|
||
import rospy | ||
import time | ||
from sensor_msgs.msg import JointState | ||
import math | ||
import pymycobot | ||
from packaging import version | ||
|
||
# min low version require | ||
MIN_REQUIRE_VERSION = '3.6.4' | ||
|
||
current_verison = pymycobot.__version__ | ||
print('current pymycobot library version: {}'.format(current_verison)) | ||
if version.parse(current_verison) < version.parse(MIN_REQUIRE_VERSION): | ||
raise RuntimeError('{}The version of pymycobot library must be greater than {} or higher. The current version is {}. Please upgrade the library version.'.format(MIN_REQUIRE_VERSION, current_verison)) | ||
else: | ||
print('pymycobot library version meets the requirements!') | ||
from pymycobot.mycobot320 import MyCobot320 | ||
|
||
|
||
mc = None | ||
gripper_value = [] | ||
|
||
def callback(data): | ||
global mc | ||
# rospy.loginfo(rospy.get_caller_id() + "%s", data.position) | ||
data_list = [] | ||
for index, value in enumerate(data.position): | ||
data_list.append(round(value, 3)) | ||
|
||
data_list = data_list[:7] | ||
angles_list = [round(math.degrees(radian), 2) for radian in data_list[:6]] | ||
print("angles:%s"%angles_list) | ||
mc.send_angles(angles_list, 25) | ||
gripper_value = int(data_list[6]* 100) | ||
print("gripper_value:%s"%gripper_value) | ||
|
||
mc.set_pro_gripper_angle(14, gripper_value) | ||
|
||
def listener(): | ||
global mc | ||
global gripper_value | ||
|
||
rospy.init_node("control_slider", anonymous=True) | ||
|
||
|
||
port = rospy.get_param("~port", "/dev/ttyACM0") | ||
baud = rospy.get_param("~baud", 115200) | ||
print(port, baud) | ||
mc = MyCobot320(port, baud) | ||
time.sleep(0.05) | ||
mc.set_fresh_mode(1) | ||
time.sleep(0.05) | ||
|
||
rospy.Subscriber("joint_states", JointState, callback) | ||
|
||
# spin() simply keeps python from exiting until this node is stopped | ||
print("spin ...") | ||
rospy.spin() | ||
|
||
|
||
if __name__ == "__main__": | ||
listener() |
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
11 changes: 11 additions & 0 deletions
11
mycobot_320/new_mycobot_320_force_gripper_moveit/.setup_assistant
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,11 @@ | ||
moveit_setup_assistant_config: | ||
URDF: | ||
package: mycobot_description | ||
relative_path: urdf/mycobot_320_m5_2022/pro_320_m5_2022_moveit_force_gripper.urdf | ||
xacro_args: "" | ||
SRDF: | ||
relative_path: config/firefighter.srdf | ||
CONFIG: | ||
author_name: wangweijian | ||
author_email: [email protected] | ||
generated_timestamp: 1732845154 |
10 changes: 10 additions & 0 deletions
10
mycobot_320/new_mycobot_320_force_gripper_moveit/CMakeLists.txt
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,10 @@ | ||
cmake_minimum_required(VERSION 3.1.3) | ||
project(new_mycobot_320_force_gripper_moveit) | ||
|
||
find_package(catkin REQUIRED) | ||
|
||
catkin_package() | ||
|
||
install(DIRECTORY launch DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION} | ||
PATTERN "setup_assistant.launch" EXCLUDE) | ||
install(DIRECTORY config DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}) |
5 changes: 5 additions & 0 deletions
5
mycobot_320/new_mycobot_320_force_gripper_moveit/config/cartesian_limits.yaml
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,5 @@ | ||
cartesian_limits: | ||
max_trans_vel: 1 | ||
max_trans_acc: 2.25 | ||
max_trans_dec: -5 | ||
max_rot_vel: 1.57 |
18 changes: 18 additions & 0 deletions
18
mycobot_320/new_mycobot_320_force_gripper_moveit/config/chomp_planning.yaml
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,18 @@ | ||
planning_time_limit: 10.0 | ||
max_iterations: 200 | ||
max_iterations_after_collision_free: 5 | ||
smoothness_cost_weight: 0.1 | ||
obstacle_cost_weight: 1.0 | ||
learning_rate: 0.01 | ||
smoothness_cost_velocity: 0.0 | ||
smoothness_cost_acceleration: 1.0 | ||
smoothness_cost_jerk: 0.0 | ||
ridge_factor: 0.0 | ||
use_pseudo_inverse: false | ||
pseudo_inverse_ridge_factor: 1e-4 | ||
joint_update_limit: 0.1 | ||
collision_clearance: 0.2 | ||
collision_threshold: 0.07 | ||
use_stochastic_descent: true | ||
enable_failure_recovery: false | ||
max_recovery_attempts: 5 |
19 changes: 19 additions & 0 deletions
19
mycobot_320/new_mycobot_320_force_gripper_moveit/config/fake_controllers.yaml
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,19 @@ | ||
controller_list: | ||
- name: fake_arm_group_controller | ||
type: $(arg fake_execution_type) | ||
joints: | ||
- joint2_to_joint1 | ||
- joint3_to_joint2 | ||
- joint4_to_joint3 | ||
- joint5_to_joint4 | ||
- joint6_to_joint5 | ||
- joint6output_to_joint6 | ||
- name: fake_gripper_group_controller | ||
type: $(arg fake_execution_type) | ||
joints: | ||
- gripper_controller | ||
initial: # Define initial robot poses per group | ||
- group: arm_group | ||
pose: init_pose | ||
- group: gripper_group | ||
pose: init_gripper |
Oops, something went wrong.