optimize the code

This commit is contained in:
wuchangji 2022-06-24 19:03:55 +08:00
parent cda8898990
commit ffb5a5eb68
4 changed files with 6 additions and 6 deletions

View file

@ -1,9 +1,9 @@
<launch>
<arg name="port" default="/dev/ttyAMA0" />
<arg name="baud" default="1000000" />
<arg name="port" default="/dev/ttyUSB0" />
<arg name="baud" default="115200" />
<!-- Open communication service -->
<node name="mypalletizer_pi_services" pkg="mypalletizer_communication" type="mypal_topics_pi.py" output="screen">
<node name="mycobot_services" pkg="mycobot_communication" type="mycobot_topics_pi.py" output="screen">
<param name="port" type="string" value="$(arg port)" />
<param name="baud" type="int" value="$(arg baud)" />
</node>

View file

View file

@ -9,7 +9,7 @@ import threading
import rospy
from pymycobot.mypalletizer import MyPalletizer
from mypalletizer_communication.msg import(
from mypalletizer_communication import(
MypalAngles,
MypalCoords,
MypalSetAngles,

View file

@ -70,8 +70,8 @@ class MypalTopics(object):
rospy.init_node("Mypal_topics")
rospy.loginfo("start ...")
# problem
port = rospy.get_param("~port", "/dev/ttyAMA0")
baud = rospy.get_param("~baud", 1000000)
port = rospy.get_param("~port", "/dev/ttyUSB0")
baud = rospy.get_param("~baud", 115200)
rospy.loginfo("%s,%s" % (port, baud))
self.mc = MyPalletizer(port,baud)
self.lock = threading.Lock()