mirror of
https://github.com/elephantrobotics/mycobot_ros.git
synced 2026-07-14 09:00:53 +00:00
Merge pull request #72 from elephantrobotics/mypalletizer260_pi
Mypalletizer260 pi
This commit is contained in:
commit
31666e2565
10 changed files with 18 additions and 11 deletions
|
|
@ -1,4 +1,5 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python2
|
||||||
|
# -*- coding:utf-8 -*-
|
||||||
import time
|
import time
|
||||||
import rospy
|
import rospy
|
||||||
from mycobot_communication.srv import *
|
from mycobot_communication.srv import *
|
||||||
|
|
|
||||||
0
mycobot_communication/scripts/mycobot_topics_jsnn.py
Normal file → Executable file
0
mycobot_communication/scripts/mycobot_topics_jsnn.py
Normal file → Executable file
0
mycobot_communication/scripts/mycobot_topics_pi.py
Normal file → Executable file
0
mycobot_communication/scripts/mycobot_topics_pi.py
Normal file → Executable file
0
mycobot_communication/scripts/mycobot_topics_seeed.py
Normal file → Executable file
0
mycobot_communication/scripts/mycobot_topics_seeed.py
Normal file → Executable file
|
|
@ -94,6 +94,7 @@
|
||||||
<geometry>
|
<geometry>
|
||||||
<!--- 0.0 0 -0.04 -->
|
<!--- 0.0 0 -0.04 -->
|
||||||
<cylinder length="0.015" radius="0.0152"/>
|
<cylinder length="0.015" radius="0.0152"/>
|
||||||
|
<!-- <mesh filename="package://mycobot_description/urdf/260_pi/link5.dae"/> -->
|
||||||
</geometry>
|
</geometry>
|
||||||
<material name = "grey">
|
<material name = "grey">
|
||||||
<color rgba = "0.5 0.5 0.5 1"/>
|
<color rgba = "0.5 0.5 0.5 1"/>
|
||||||
|
|
@ -129,15 +130,15 @@
|
||||||
|
|
||||||
<joint name="joint3_to_joint2" type="revolute">
|
<joint name="joint3_to_joint2" type="revolute">
|
||||||
<axis xyz=" 0 0 1"/>
|
<axis xyz=" 0 0 1"/>
|
||||||
<limit effort = "1000.0" lower = "-0.213" upper = "1.106" velocity = "0"/>
|
<limit effort = "1000.0" lower = "-0.213" upper = "0.872665" velocity = "0"/>
|
||||||
<parent link="link2"/>
|
<parent link="link2"/>
|
||||||
<child link="link3"/>
|
<child link="link3"/>
|
||||||
<origin xyz= "0.0 -0.14 0 " rpy = "0 0 0 "/>
|
<origin xyz= "0.0 -0.14 0 " rpy = "0 0 0 "/>
|
||||||
</joint>
|
</joint>
|
||||||
|
|
||||||
<joint name="joint4_to_joint3" type="revolute">
|
<joint name="joint4_to_joint3" type="fixed">
|
||||||
<axis xyz=" 0 0 1"/>
|
<!-- <axis xyz=" 0 0 1"/> -->
|
||||||
<limit effort = "1000.0" lower = "0" upper = "1.5707963" velocity = "0"/>
|
<!-- <limit effort = "1000.0" lower = "0" upper = "1.5707963" velocity = "0"/> -->
|
||||||
<parent link="link3"/>
|
<parent link="link3"/>
|
||||||
<child link="link4"/>
|
<child link="link4"/>
|
||||||
<origin xyz= "0.134 -0.005 0.0" rpy = "3.1415926 0 0 "/>
|
<origin xyz= "0.134 -0.005 0.0" rpy = "3.1415926 0 0 "/>
|
||||||
|
|
|
||||||
|
|
@ -138,8 +138,10 @@ def teleop_keyboard():
|
||||||
switch_gripper(False)
|
switch_gripper(False)
|
||||||
elif key == "1":
|
elif key == "1":
|
||||||
rsp = set_angles(*init_pose)
|
rsp = set_angles(*init_pose)
|
||||||
|
record_coords = [res.x, res.y, res.z, res.rx, speed, model]
|
||||||
elif key in "2":
|
elif key in "2":
|
||||||
rsp = set_angles(*home_pose)
|
rsp = set_angles(*home_pose)
|
||||||
|
record_coords = [res.x, res.y, res.z, res.rx, speed, model]
|
||||||
elif key in "3":
|
elif key in "3":
|
||||||
rep = get_angles()
|
rep = get_angles()
|
||||||
home_pose[0] = rep.joint_1
|
home_pose[0] = rep.joint_1
|
||||||
|
|
|
||||||
|
|
@ -7,6 +7,7 @@ Panels:
|
||||||
- /Global Options1
|
- /Global Options1
|
||||||
- /Status1
|
- /Status1
|
||||||
- /RobotModel1
|
- /RobotModel1
|
||||||
|
- /RobotModel1/Status1
|
||||||
- /TF1
|
- /TF1
|
||||||
Splitter Ratio: 0.5
|
Splitter Ratio: 0.5
|
||||||
Tree Height: 645
|
Tree Height: 645
|
||||||
|
|
@ -170,10 +171,10 @@ Visualization Manager:
|
||||||
Invert Z Axis: false
|
Invert Z Axis: false
|
||||||
Name: Current View
|
Name: Current View
|
||||||
Near Clip Distance: 0.00999999978
|
Near Clip Distance: 0.00999999978
|
||||||
Pitch: 0.120398536
|
Pitch: 0.300398558
|
||||||
Target Frame: <Fixed Frame>
|
Target Frame: <Fixed Frame>
|
||||||
Value: Orbit (rviz)
|
Value: Orbit (rviz)
|
||||||
Yaw: 2.79040861
|
Yaw: 1.56040955
|
||||||
Saved: ~
|
Saved: ~
|
||||||
Window Geometry:
|
Window Geometry:
|
||||||
Displays:
|
Displays:
|
||||||
|
|
|
||||||
|
|
@ -15,8 +15,8 @@ def talker():
|
||||||
rospy.init_node("display", anonymous=True)
|
rospy.init_node("display", anonymous=True)
|
||||||
|
|
||||||
print("Try connect real mypal...")
|
print("Try connect real mypal...")
|
||||||
port = rospy.get_param("~port", "/dev/ttyUSB0")
|
port = rospy.get_param("~port", "/dev/ttyAMA0")
|
||||||
baud = rospy.get_param("~baud", 115200)
|
baud = rospy.get_param("~baud", 1000000)
|
||||||
print("port: {}, baud: {}\n".format(port, baud))
|
print("port: {}, baud: {}\n".format(port, baud))
|
||||||
try:
|
try:
|
||||||
mypa = MyPalletizer(port, baud)
|
mypa = MyPalletizer(port, baud)
|
||||||
|
|
|
||||||
|
|
@ -26,7 +26,7 @@ def callback(data):
|
||||||
data_list = []
|
data_list = []
|
||||||
for index, value in enumerate(data.position):
|
for index, value in enumerate(data.position):
|
||||||
data_list.append(value)
|
data_list.append(value)
|
||||||
del data_list[3] # delete the angle of joint3 to joint4,because it do not exsist actually! 把joint3到joint4的角度删掉,因为它实际上不存在!
|
# del data_list[3] # delete the angle of joint3 to joint4,because it do not exsist actually! 把joint3到joint4的角度删掉,因为它实际上不存在!
|
||||||
# data_list[3] = data_list[4]
|
# data_list[3] = data_list[4]
|
||||||
# print(data_list)
|
# print(data_list)
|
||||||
mc.send_radians(data_list, 80)
|
mc.send_radians(data_list, 80)
|
||||||
|
|
@ -38,8 +38,8 @@ def listener():
|
||||||
rospy.init_node("control_slider", anonymous=True)
|
rospy.init_node("control_slider", anonymous=True)
|
||||||
|
|
||||||
rospy.Subscriber("joint_states", JointState, callback)
|
rospy.Subscriber("joint_states", JointState, callback)
|
||||||
port = rospy.get_param("~port", "/dev/ttyUSB0") # Select connected device. 选择连接设备
|
port = rospy.get_param("~port", "/dev/ttyAMA0") # Select connected device. 选择连接设备
|
||||||
baud = rospy.get_param("~baud", 115200)
|
baud = rospy.get_param("~baud", 1000000)
|
||||||
print(port, baud)
|
print(port, baud)
|
||||||
mc = MyPalletizer(port, baud)
|
mc = MyPalletizer(port, baud)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -139,8 +139,10 @@ def teleop_keyboard():
|
||||||
switch_gripper(False)
|
switch_gripper(False)
|
||||||
elif key == "1":
|
elif key == "1":
|
||||||
rsp = set_angles(*init_pose)
|
rsp = set_angles(*init_pose)
|
||||||
|
record_coords = [res.x, res.y, res.z, res.rx, speed, model]
|
||||||
elif key in "2":
|
elif key in "2":
|
||||||
rsp = set_angles(*home_pose)
|
rsp = set_angles(*home_pose)
|
||||||
|
record_coords = [res.x, res.y, res.z, res.rx, speed, model]
|
||||||
elif key in "3":
|
elif key in "3":
|
||||||
rep = get_angles()
|
rep = get_angles()
|
||||||
home_pose[0] = rep.joint_1
|
home_pose[0] = rep.joint_1
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue