-
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.
- Loading branch information
Showing
59 changed files
with
39,946 additions
and
137 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 |
---|---|---|
@@ -1,11 +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/force_control_gripper/force_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> | ||
<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> |
61 changes: 61 additions & 0 deletions
61
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,61 @@ | ||
#!/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 | ||
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
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
Oops, something went wrong.