mirror of
https://github.com/elephantrobotics/mycobot_ros.git
synced 2026-07-05 19:47:04 +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
|
||||
# -*- coding: utf-8 -*-
|
||||
import math
|
||||
|
||||
import rospy
|
||||
from sensor_msgs.msg import JointState
|
||||
from std_msgs.msg import Header
|
||||
|
|
@ -11,7 +11,6 @@ from mypalletizer_communication.msg import MypalAngles
|
|||
class Listener(object):
|
||||
def __init__(self):
|
||||
super(Listener, self).__init__()
|
||||
|
||||
rospy.loginfo("start ...")
|
||||
rospy.init_node("real_listener_1", anonymous=True)
|
||||
# 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 signal
|
||||
import threading
|
||||
|
||||
import rospy
|
||||
from pymycobot.mypalletizer import MyPalletizer
|
||||
|
||||
from mypalletizer_communication import(
|
||||
from mypalletizer_communication.msg import(
|
||||
MypalAngles,
|
||||
MypalCoords,
|
||||
MypalSetAngles,
|
||||
|
|
@ -129,7 +128,6 @@ class MypalTopics(object):
|
|||
pub = rospy.Publisher("Mypal/coords_real",
|
||||
MypalCoords, queue_size=5)
|
||||
ma = MypalCoords()
|
||||
|
||||
while not rospy.is_shutdown():
|
||||
self.lock.acquire()
|
||||
coords = self.mc.get_coords()
|
||||
|
|
@ -153,7 +151,7 @@ class MypalTopics(object):
|
|||
data.joint_2,
|
||||
data.joint_3,
|
||||
data.joint_4,
|
||||
# data.joint_5,
|
||||
data.joint_5,
|
||||
# data.joint_6,
|
||||
]
|
||||
sp = int(data.speed)
|
||||
|
|
@ -168,7 +166,6 @@ class MypalTopics(object):
|
|||
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]
|
||||
|
||||
sp = int(data.speed)
|
||||
model = int(data.model)
|
||||
self.mc.send_coords(angles, sp, model)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue