mirror of
https://github.com/elephantrobotics/mycobot_ros.git
synced 2026-07-14 09:00:53 +00:00
fix
This commit is contained in:
parent
8317486de9
commit
ada5e77323
2 changed files with 3 additions and 7 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python2
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
import math
|
import math
|
||||||
|
|
||||||
import rospy
|
import rospy
|
||||||
from sensor_msgs.msg import JointState
|
from sensor_msgs.msg import JointState
|
||||||
from std_msgs.msg import Header
|
from std_msgs.msg import Header
|
||||||
|
|
@ -11,7 +11,6 @@ from mypalletizer_communication.msg import MypalAngles
|
||||||
class Listener(object):
|
class Listener(object):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super(Listener, self).__init__()
|
super(Listener, self).__init__()
|
||||||
|
|
||||||
rospy.loginfo("start ...")
|
rospy.loginfo("start ...")
|
||||||
rospy.init_node("real_listener_1", anonymous=True)
|
rospy.init_node("real_listener_1", anonymous=True)
|
||||||
# init publisher. 初始化发布者
|
# init publisher. 初始化发布者
|
||||||
|
|
|
||||||
7
mypalletizer_260/mypalletizer_communication/scripts/mypal_topics.py
Normal file → Executable file
7
mypalletizer_260/mypalletizer_communication/scripts/mypal_topics.py
Normal file → Executable file
|
|
@ -5,11 +5,10 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import signal
|
import signal
|
||||||
import threading
|
import threading
|
||||||
|
|
||||||
import rospy
|
import rospy
|
||||||
from pymycobot.mypalletizer import MyPalletizer
|
from pymycobot.mypalletizer import MyPalletizer
|
||||||
|
|
||||||
from mypalletizer_communication import(
|
from mypalletizer_communication.msg import(
|
||||||
MypalAngles,
|
MypalAngles,
|
||||||
MypalCoords,
|
MypalCoords,
|
||||||
MypalSetAngles,
|
MypalSetAngles,
|
||||||
|
|
@ -129,7 +128,6 @@ class MypalTopics(object):
|
||||||
pub = rospy.Publisher("Mypal/coords_real",
|
pub = rospy.Publisher("Mypal/coords_real",
|
||||||
MypalCoords, queue_size=5)
|
MypalCoords, queue_size=5)
|
||||||
ma = MypalCoords()
|
ma = MypalCoords()
|
||||||
|
|
||||||
while not rospy.is_shutdown():
|
while not rospy.is_shutdown():
|
||||||
self.lock.acquire()
|
self.lock.acquire()
|
||||||
coords = self.mc.get_coords()
|
coords = self.mc.get_coords()
|
||||||
|
|
@ -153,7 +151,7 @@ class MypalTopics(object):
|
||||||
data.joint_2,
|
data.joint_2,
|
||||||
data.joint_3,
|
data.joint_3,
|
||||||
data.joint_4,
|
data.joint_4,
|
||||||
# data.joint_5,
|
data.joint_5,
|
||||||
# data.joint_6,
|
# data.joint_6,
|
||||||
]
|
]
|
||||||
sp = int(data.speed)
|
sp = int(data.speed)
|
||||||
|
|
@ -168,7 +166,6 @@ class MypalTopics(object):
|
||||||
def callback(data):
|
def callback(data):
|
||||||
# angles = [data.x, data.y, data.z, data.rx, data.ry, data.rz]
|
# angles = [data.x, data.y, data.z, data.rx, data.ry, data.rz]
|
||||||
angles = [data.x, data.y, data.z, data.rx]
|
angles = [data.x, data.y, data.z, data.rx]
|
||||||
|
|
||||||
sp = int(data.speed)
|
sp = int(data.speed)
|
||||||
model = int(data.model)
|
model = int(data.model)
|
||||||
self.mc.send_coords(angles, sp, model)
|
self.mc.send_coords(angles, sp, model)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue