将 ros中cobotx相关的名称重命名为mercury

This commit is contained in:
wangWking 2023-11-15 11:21:08 +08:00
parent 406ab9d77e
commit 9725aff6ab
184 changed files with 434 additions and 297 deletions

View file

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8.3)
project(cobotx_a450)
project(mercury_a1)
add_compile_options(-std=c++11)
## Find catkin and any catkin packages

View file

@ -1,7 +1,7 @@
<launch>
<!-- Load URDF file,加载URDF文件 -->
<arg name="model" default="$(find mycobot_description)/urdf/cobotx_a450/cobotx_a450.urdf"/>
<arg name="rvizconfig" default="$(find cobotx_a450)/config/cobotx_a450.rviz" />
<arg name="model" default="$(find mycobot_description)/urdf/mercury_a1/mercury_a1.urdf"/>
<arg name="rvizconfig" default="$(find mercury_a1)/config/mercury_a1.rviz" />
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
<!-- Combinejoin values to TF 将值合并到TF-->

View file

@ -3,8 +3,8 @@
<arg name="port" default="/dev/ttyAMA1" />
<arg name="baud" default="115200" />
<arg name="model" default="$(find mycobot_description)/urdf/cobotx_a450/cobotx_a450.urdf"/>
<arg name="rvizconfig" default="$(find cobotx_a450)/config/cobotx_a450.rviz" />
<arg name="model" default="$(find mycobot_description)/urdf/mercury_a1/mercury_a1.urdf"/>
<arg name="rvizconfig" default="$(find mercury_a1)/config/mercury_a1.rviz" />
<arg name="gui" default="false" />
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
@ -14,10 +14,10 @@
<!-- Show in Rviz 显示在Rviz-->
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />
<include file="$(find cobotx_a450_communication)/launch/communication_service.launch">
<include file="$(find mercury_a1_communication)/launch/communication_service.launch">
<arg name="port" value="$(arg port)" />
<arg name="baud" value="$(arg baud)" />
</include>
<node name="real_listener" pkg="cobotx_a450" type="listen_real.py" />
<node name="simple_gui" pkg="cobotx_a450" type="simple_gui.py" />
<node name="real_listener" pkg="mercury_a1" type="listen_real.py" />
<node name="simple_gui" pkg="mercury_a1" type="simple_gui.py" />
</launch>

View file

@ -2,8 +2,8 @@
<!-- <arg name="port" default="/dev/ttyUSB0" />
<arg name="baud" default="115200" /> -->
<!-- Load file model ,加载文件模型-->
<arg name="model" default="$(find mycobot_description)/urdf/cobotx_b450/cobotx_b450.urdf"/>
<arg name="rvizconfig" default="$(find cobotx_b450)/config/cobotx_b450.rviz" />
<arg name="model" default="$(find mycobot_description)/urdf/mercury_a1/mercury_a1.urdf"/>
<arg name="rvizconfig" default="$(find mercury_a1)/config/mercury_a1.rviz" />
<arg name="gui" default="true" />
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />

View file

@ -3,8 +3,8 @@
<arg name="port" default="/dev/ttyAMA1" />
<arg name="baud" default="115200" />
<arg name="model" default="$(find mycobot_description)/urdf/cobotx_a450/cobotx_a450.urdf"/>
<arg name="rvizconfig" default="$(find cobotx_a450)/config/cobotx_a450.rviz" />
<arg name="model" default="$(find mycobot_description)/urdf/mercury_a1/mercury_a1.urdf"/>
<arg name="rvizconfig" default="$(find mercury_a1)/config/mercury_a1.rviz" />
<arg name="gui" default="false" />
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
@ -14,10 +14,10 @@
<!-- Show in Rviz 显示在Rviz-->
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />
<include file="$(find cobotx_a450_communication)/launch/communication_service.launch">
<include file="$(find mercury_a1_communication)/launch/communication_service.launch">
<arg name="port" value="$(arg port)" />
<arg name="baud" value="$(arg baud)" />
</include>
<!-- listen and pub the real angles ,监听并发布真实角度-->
<node name="real_listener" pkg="cobotx_a450" type="listen_real.py" />
<node name="real_listener" pkg="mercury_a1" type="listen_real.py" />
</launch>

View file

@ -1,6 +1,6 @@
<launch>
<arg name="model" default="$(find mycobot_description)/urdf/cobotx_a450/cobotx_a450.urdf"/>
<arg name="rvizconfig" default="$(find cobotx_a450)/config/cobotx_a450.rviz" />
<arg name="model" default="$(find mycobot_description)/urdf/mercury_a1/mercury_a1.urdf"/>
<arg name="rvizconfig" default="$(find mercury_a1)/config/mercury_a1.rviz" />
<arg name="gui" default="true" />
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />

View file

@ -1,8 +1,8 @@
<?xml version="1.0"?>
<package format="2">
<name>cobotx_b450</name>
<name>mercury_a1</name>
<version>0.3.0</version>
<description>The cobotx_b450 package</description>
<description>The mercury_a1 package</description>
<author email="weijian.wang@elephantrobotics.com">Wangweijian</author>
<maintainer email="weijian.wang@elephantrobotics.com">Wangweijian</maintainer>
@ -18,9 +18,9 @@
<build_depend>std_msgs</build_depend>
<build_depend>actionlib</build_depend>
<build_depend>mycobot_description</build_depend>
<build_depend>cobotx_a450_communication</build_depend>
<build_depend>mercury_a1_communication</build_depend>
<build_export_depend>cobotx_a450_communication</build_export_depend>
<build_export_depend>mercury_a1_communication</build_export_depend>
<build_export_depend>mycobot_description</build_export_depend>
<exec_depend>roscpp</exec_depend>
@ -36,7 +36,7 @@
<exec_depend>controller_manager</exec_depend>
<exec_depend>python-tk</exec_depend>
<exec_depend>mycobot_description</exec_depend>
<exec_depend>cobotx_a450_communication</exec_depend>
<exec_depend>mercury_a1_communication</exec_depend>
<!-- The export tag contains other, unspecified, tags -->

View file

@ -6,24 +6,24 @@ from sensor_msgs.msg import JointState
from std_msgs.msg import Header
from visualization_msgs.msg import Marker
from pymycobot.cobotx import CobotX
from pymycobot.mercury import Mercury
def talker():
rospy.init_node("display", anonymous=True)
print("Try connect real CobotX...")
print("Try connect real Mercury...")
port = rospy.get_param("~port", "/dev/ttyAMA1")
baud = rospy.get_param("~baud", 115200)
print("port: {}, baud: {}\n".format(port, baud))
try:
mc = CobotX(port, baud)
mc = Mercury(port, baud)
except Exception as e:
print(e)
print(
"""\
\rTry connect CobotX failed!
\rPlease check wether connected with CobotX.
\rTry connect Mercury failed!
\rPlease check wether connected with Mercury.
\rPlease chckt wether the port or baud is right.
"""
)

View file

@ -7,7 +7,7 @@ import math
import rospy
from sensor_msgs.msg import JointState
from std_msgs.msg import Header
from cobotx_a450_communication.srv import GetAngles
from mercury_a1_communication.srv import GetAngles
def talker():

View file

@ -5,7 +5,7 @@ import math
import rospy
from sensor_msgs.msg import JointState
from std_msgs.msg import Header
from cobotx_a450_communication.msg import CobotXAngles
from mercury_a1_communication.msg import MercuryAngles
class Listener(object):
@ -17,14 +17,14 @@ class Listener(object):
# init publisher.初始化发布者
self.pub = rospy.Publisher("joint_states", JointState, queue_size=10)
# init subscriber.初始化订阅者
self.sub = rospy.Subscriber("myarm/angles_real", CobotXAngles, self.callback)
self.sub = rospy.Subscriber("myarm/angles_real", MercuryAngles, self.callback)
rospy.spin()
def callback(self, data):
"""`cobotx/angles_real` subscriber callback method.
"""`mercury/angles_real` subscriber callback method.
Args:
data (CobotXAngles): callback argument.
data (MercuryAngles): callback argument.
"""
# ini publisher object. 初始化发布者对象
joint_state_send = JointState()

View file

@ -4,7 +4,7 @@ try:
import tkinter as tk
except ImportError:
import Tkinter as tk
from cobotx_a450_communication.srv import GetCoords, SetCoords, GetAngles, SetAngles, GripperStatus
from mercury_a1_communication.srv import GetCoords, SetCoords, GetAngles, SetAngles, GripperStatus
import rospy
import time
from rospy import ServiceException
@ -493,7 +493,7 @@ class Window:
def main():
window = tk.Tk()
window.title("CobotX ros GUI")
window.title("Mercury ros GUI")
Window(window).run()

View file

@ -12,7 +12,7 @@ import math
import rospy
from sensor_msgs.msg import JointState
from pymycobot.cobotx import CobotX
from pymycobot.mercury import Mercury
mc = None
@ -20,7 +20,9 @@ mc = None
def callback(data):
# rospy.loginfo(rospy.get_caller_id() + "%s", data.position)
print(data.position)
# print(data.position)
rounded_data_tuple = tuple(round(value, 2) for value in data.position)
rospy.loginfo(rospy.get_caller_id() + "%s", rounded_data_tuple)
data_list = []
for index, value in enumerate(data.position):
radians_to_angles = math.degrees(value)
@ -39,7 +41,7 @@ def listener():
port = rospy.get_param("~port", "/dev/ttyAMA1")
baud = rospy.get_param("~baud", 115200)
print(port, baud)
mc = CobotX(port, baud)
mc = Mercury(port, baud)
# spin() simply keeps python from exiting until this node is stopped
# spin()只是阻止python退出直到该节点停止

View file

@ -1,18 +1,16 @@
#!/usr/bin/env python3
from __future__ import print_function
from cobotx_a450_communication.srv import GetCoords, SetCoords, GetAngles, SetAngles, GripperStatus
from mercury_a1_communication.srv import GetCoords, SetCoords, GetAngles, SetAngles, GripperStatus
import rospy
import sys
import select
import termios
import tty
import time
import roslib
# Terminal output prompt information. 终端输出提示信息
msg = """\
CobotX Teleop Keyboard Controller
Mercury Teleop Keyboard Controller
---------------------------
Movimg options(control coordinations [x,y,z,rx,ry,rz]):
w(x+)

View file

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8.3)
project(cobotx_a450_communication)
project(mercury_a1_communication)
add_compile_options(-std=c++11)
## Compile as C++11, supported in ROS Kinetic and newer
@ -50,12 +50,12 @@ find_package(catkin REQUIRED COMPONENTS
## Generate messages in the 'msg' folder
add_message_files(FILES
CobotXAngles.msg
CobotXCoords.msg
CobotXSetAngles.msg
CobotXSetCoords.msg
CobotXGripperStatus.msg
CobotXPumpStatus.msg
MercuryAngles.msg
MercuryCoords.msg
MercurySetAngles.msg
MercurySetCoords.msg
MercuryGripperStatus.msg
MercuryPumpStatus.msg
)
## Generate services in the 'srv' folder
@ -169,8 +169,8 @@ include_directories(
## Mark executable scripts (Python etc.) for installation
## in contrast to setup.py, you can choose the destination
catkin_install_python(PROGRAMS
scripts/cobotx_services.py
scripts/cobotx_topics.py
scripts/mercury_services.py
scripts/mercury_topics.py
DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

View file

@ -6,7 +6,7 @@
<!-- Open communication service ,开启通讯服务-->
<node name="cobotx_services" pkg="cobotx_a450_communication" type="cobotx_services.py" output="screen">
<node name="mercury_services" pkg="mercury_a1_communication" type="mercury_services.py" output="screen">
<param name="port" type="string" value="$(arg port)" />
<param name="baud" type="int" value="$(arg baud)" />
</node>

View file

@ -4,7 +4,7 @@
<arg name="baud" default="115200" />
<!-- Open communication service开启通讯服务 -->
<node name="cobotx_services" pkg="cobotx_a450_communication" type="cobotx_topics.py" output="screen">
<node name="mercury_services" pkg="mercury_a1_communication" type="mercury_topics.py" output="screen">
<param name="port" type="string" value="$(arg port)" />
<param name="baud" type="int" value="$(arg baud)" />
</node>

View file

@ -4,7 +4,7 @@
<arg name="baud" default="115200" />
<!-- Open communication service --><!-- 开启通讯服务 -->
<node name="cobotx_services" pkg="cobotx_a450_communication" type="cobotx_topics_pi.py" output="screen">
<node name="mercury_services" pkg="mercury_a1_communication" type="mercury_topics_pi.py" output="screen">
<param name="port" type="string" value="$(arg port)" />
<param name="baud" type="int" value="$(arg baud)" />
</node>

View file

@ -1,8 +1,8 @@
<?xml version="1.0"?>
<package format="2">
<name>cobotx_a450_communication</name>
<name>mercury_a1_communication</name>
<version>0.1.0</version>
<description>The cobotx_a450_communication package</description>
<description>The mercury_a1_communication package</description>
<!-- One maintainer tag required, multiple allowed, one person per tag -->
<!-- Example: -->

View file

@ -4,9 +4,9 @@ import time
import rospy
import os
import fcntl
from cobotx_a450_communication.srv import *
from mercury_a1_communication.srv import *
from pymycobot.cobotx import CobotX
from pymycobot.mercury import Mercury
mc = None
@ -51,12 +51,12 @@ def release(lock_file_fd):
def create_handle():
global mc
rospy.init_node("cobotx")
rospy.init_node("mercury")
rospy.loginfo("start ...")
port = rospy.get_param("~port")
baud = rospy.get_param("~baud")
rospy.loginfo("%s,%s" % (port, baud))
mc = CobotX(port, baud)
mc = Mercury(port, baud)
def create_services():
@ -84,7 +84,7 @@ def set_angles(req):
sp = req.speed
if mc:
lock = acquire("/tmp/cobotx_lock")
lock = acquire("/tmp/mercury_lock")
mc.send_angles(angles, sp)
release(lock)
@ -94,7 +94,7 @@ def set_angles(req):
def get_angles(req):
"""get angles,获取角度"""
if mc:
lock = acquire("/tmp/cobotx_lock")
lock = acquire("/tmp/mercury_lock")
angles = mc.get_angles()
release(lock)
return GetAnglesResponse(*angles)
@ -113,7 +113,7 @@ def set_coords(req):
mod = req.model
if mc:
lock = acquire("/tmp/cobotx_lock")
lock = acquire("/tmp/mercury_lock")
mc.send_coords(coords, sp, mod)
release(lock)
@ -122,7 +122,7 @@ def set_coords(req):
def get_coords(req):
if mc:
lock = acquire("/tmp/cobotx_lock")
lock = acquire("/tmp/mercury_lock")
coords = mc.get_coords()
release(lock)
return GetCoordsResponse(*coords)
@ -132,7 +132,7 @@ def switch_status(req):
"""Gripper switch status"""
"""夹爪开关状态"""
if mc:
lock = acquire("/tmp/cobotx_lock")
lock = acquire("/tmp/mercury_lock")
if req.Status:
mc.set_gripper_state(0, 80)
else:
@ -144,7 +144,7 @@ def switch_status(req):
def toggle_pump(req):
if mc:
lock = acquire("/tmp/cobotx_lock")
lock = acquire("/tmp/mercury_lock")
if req.Status:
mc.set_basic_output(req.Pin1, 0)
mc.set_basic_output(req.Pin2, 0)
@ -158,7 +158,7 @@ def toggle_pump(req):
robot_msg = """
Cobotx Status
Mercury Status
--------------------------------
Joint Limit:
joint 1: -165 ~ +165
@ -186,13 +186,13 @@ def output_robot_message():
atom_version = "unknown"
if mc:
lock = acquire("/tmp/cobotx_lock")
lock = acquire("/tmp/mercury_lock")
cn = mc.is_controller_connected()
release(lock)
if cn == 1:
connect_status = True
time.sleep(0.1)
lock = acquire("/tmp/cobotx_lock")
lock = acquire("/tmp/mercury_lock")
si = mc.is_all_servo_enable()
release(lock)
if si == 1:

View file

@ -8,16 +8,16 @@ import threading
import rospy
from cobotx_a450_communication.msg import (
CobotXAngles,
CobotXCoords,
CobotXSetAngles,
CobotXSetCoords,
CobotXGripperStatus,
CobotXPumpStatus,
from mercury_a1_communication.msg import (
MercuryAngles,
MercuryCoords,
MercurySetAngles,
MercurySetCoords,
MercuryGripperStatus,
MercuryPumpStatus,
)
from pymycobot.cobotx import CobotX
from pymycobot.mercury import Mercury
class Watcher:
@ -64,11 +64,11 @@ class Watcher:
pass
class CobotXTopics(object):
class MercuryTopics(object):
def __init__(self):
super(CobotXTopics, self).__init__()
super(MercuryTopics, self).__init__()
rospy.init_node("cobotx_topics")
rospy.init_node("mercury_topics")
rospy.loginfo("start ...")
# port = rospy.get_param("~port", os.popen("ls /dev/ttyAMA*").readline()[:-1])
port = rospy.get_param("~port", "/dev/ttyAMA1")
@ -76,7 +76,7 @@ class CobotXTopics(object):
port = rospy.get_param("~port", os.popen("ls /dev/ttyACM*").readline()[:-1])
baud = rospy.get_param("~baud", 115200)
rospy.loginfo("%s,%s" % (port, baud))
self.mc = CobotX(port, baud)
self.mc = Mercury(port, baud)
self.lock = threading.Lock()
def start(self):
@ -110,9 +110,9 @@ class CobotXTopics(object):
def pub_real_angles(self):
"""Publish real angle"""
"""发布真实角度"""
pub = rospy.Publisher("cobotx/angles_real",
CobotXAngles, queue_size=5)
ma = CobotXAngles()
pub = rospy.Publisher("mercury/angles_real",
MercuryAngles, queue_size=5)
ma = MercuryAngles()
while not rospy.is_shutdown():
self.lock.acquire()
angles = self.mc.get_angles()
@ -131,9 +131,9 @@ class CobotXTopics(object):
def pub_real_coords(self):
"""publish real coordinates"""
"""发布真实坐标"""
pub = rospy.Publisher("cobotx/coords_real",
CobotXCoords, queue_size=5)
ma = CobotXCoords()
pub = rospy.Publisher("mercury/coords_real",
MercuryCoords, queue_size=5)
ma = MercuryCoords()
while not rospy.is_shutdown():
self.lock.acquire()
@ -166,7 +166,7 @@ class CobotXTopics(object):
self.mc.send_angles(angles, sp)
sub = rospy.Subscriber(
"cobotx/angles_goal", CobotXSetAngles, callback=callback
"mercury/angles_goal", MercurySetAngles, callback=callback
)
rospy.spin()
@ -178,7 +178,7 @@ class CobotXTopics(object):
self.mc.send_coords(angles, sp, model)
sub = rospy.Subscriber(
"cobotx/coords_goal", CobotXSetCoords, callback=callback
"mercury/coords_goal", MercurySetCoords, callback=callback
)
rospy.spin()
@ -192,7 +192,7 @@ class CobotXTopics(object):
self.mc.set_gripper_state(1, 80)
sub = rospy.Subscriber(
"cobotx/gripper_status", CobotXGripperStatus, callback=callback
"mercury/gripper_status", MercuryGripperStatus, callback=callback
)
rospy.spin()
@ -206,14 +206,14 @@ class CobotXTopics(object):
self.mc.set_basic_output(data.Pin2, 1)
sub = rospy.Subscriber(
"cobotx/pump_status", CobotXPumpStatus, callback=callback
"mercury/pump_status", MercuryPumpStatus, callback=callback
)
rospy.spin()
if __name__ == "__main__":
Watcher()
mc_topics = CobotXTopics()
mc_topics = MercuryTopics()
mc_topics.start()
# while True:
# mc_topics.pub_real_coords()

View file

@ -8,17 +8,17 @@ import threading
import rospy
from cobotx_a450_communication.msg import (
CobotXAngles,
CobotXCoords,
CobotXSetAngles,
CobotXSetCoords,
CobotXGripperStatus,
CobotXPumpStatus,
from mercury_a1_communication.msg import (
MercuryAngles,
MercuryCoords,
MercurySetAngles,
MercurySetCoords,
MercuryGripperStatus,
MercuryPumpStatus,
)
from pymycobot import CobotX
from pymycobot.mercury import Mercury
class Watcher:
@ -66,18 +66,18 @@ class Watcher:
pass
class CobotXTopics(object):
class MercuryTopics(object):
def __init__(self):
super(CobotXTopics, self).__init__()
super(MercuryTopics, self).__init__()
rospy.init_node("cobotx_topics_pi")
rospy.init_node("mercury_topics_pi")
rospy.loginfo("start ...")
# problem
# port = rospy.get_param("~port", os.popen("ls /dev/ttyAMA*").readline()[:-1])
port = rospy.get_param("~port", "/dev/ttyAMA1")
baud = rospy.get_param("~baud", 115200)
rospy.loginfo("%s,%s" % (port, baud))
self.mc = CobotX(port, baud)
self.mc = Mercury(port, baud)
self.lock = threading.Lock()
def start(self):
@ -111,8 +111,8 @@ class CobotXTopics(object):
def pub_real_angles(self):
"""Publish real angle"""
"""发布真实角度"""
pub = rospy.Publisher("cobotx/angles_real", CobotXAngles, queue_size=5)
ma = CobotXAngles()
pub = rospy.Publisher("mercury/angles_real", MercuryAngles, queue_size=5)
ma = MercuryAngles()
while not rospy.is_shutdown():
self.lock.acquire()
angles = self.mc.get_angles()
@ -131,8 +131,8 @@ class CobotXTopics(object):
def pub_real_coords(self):
"""publish real coordinates"""
"""发布真实坐标"""
pub = rospy.Publisher("cobotx/coords_real", CobotXCoords, queue_size=5)
ma = CobotXCoords()
pub = rospy.Publisher("mercury/coords_real", MercuryCoords, queue_size=5)
ma = MercuryCoords()
while not rospy.is_shutdown():
self.lock.acquire()
@ -165,7 +165,7 @@ class CobotXTopics(object):
self.mc.send_angles(angles, sp)
sub = rospy.Subscriber(
"cobotx/angles_goal", CobotXSetAngles, callback=callback
"mercury/angles_goal", MercurySetAngles, callback=callback
)
rospy.spin()
@ -177,7 +177,7 @@ class CobotXTopics(object):
self.mc.send_coords(angles, sp, model)
sub = rospy.Subscriber(
"cobotx/coords_goal", CobotXSetCoords, callback=callback
"mercury/coords_goal", MercurySetCoords, callback=callback
)
rospy.spin()
@ -191,7 +191,7 @@ class CobotXTopics(object):
self.mc.set_gripper_state(1, 80)
sub = rospy.Subscriber(
"cobotx/gripper_status", CobotXGripperStatus, callback=callback
"mercury/gripper_status", MercuryGripperStatus, callback=callback
)
rospy.spin()
@ -205,13 +205,13 @@ class CobotXTopics(object):
self.mc.set_basic_output(data.Pin2, 1)
sub = rospy.Subscriber(
"cobotx/pump_status", CobotXPumpStatus, callback=callback
"mercury/pump_status", MercuryPumpStatus, callback=callback
)
rospy.spin()
if __name__ == "__main__":
Watcher()
mc_topics = CobotXTopics()
mc_topics = MercuryTopics()
mc_topics.start()
# while True:
# mc_topics.pub_real_coords()

View file

@ -1,7 +1,7 @@
moveit_setup_assistant_config:
URDF:
package: mycobot_description
relative_path: urdf/cobotx_a450/cobotx_a450.urdf
relative_path: urdf/mercury_a1/mercury_a1.urdf
xacro_args: "--inorder "
SRDF:
relative_path: config/firefighter.srdf

View file

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.1.3)
project(cobotx_b450_moveit)
project(mercury_a1_moveit)
find_package(catkin REQUIRED)

View file

@ -17,5 +17,5 @@
<param name="start_state_max_bounds_error" value="$(arg start_state_max_bounds_error)" />
<param name="jiggle_fraction" value="$(arg jiggle_fraction)" />
<rosparam command="load" file="$(find cobotx_a450_moveit)/config/chomp_planning.yaml" />
<rosparam command="load" file="$(find mercury_a1_moveit)/config/chomp_planning.yaml" />
</launch>

View file

@ -2,7 +2,7 @@
<arg name="reset" default="false"/>
<!-- If not specified, we'll use a default database location -->
<arg name="moveit_warehouse_database_path" default="$(find cobotx_a450_moveit)/default_warehouse_mongo_db" />
<arg name="moveit_warehouse_database_path" default="$(find mercury_a1_moveit)/default_warehouse_mongo_db" />
<!-- Launch the warehouse with the configured database location -->
<include file="$(dirname)/warehouse.launch">

View file

@ -6,7 +6,7 @@
<!-- By default, we do not start a database (it can be large) -->
<arg name="db" default="false" />
<!-- Allow user to specify database location -->
<arg name="db_path" default="$(find cobotx_a450_moveit)/default_warehouse_mongo_db" />
<arg name="db_path" default="$(find mercury_a1_moveit)/default_warehouse_mongo_db" />
<!-- By default, we are not in debug mode -->
<arg name="debug" default="false" />

View file

@ -7,6 +7,6 @@
<param name="moveit_controller_manager" value="moveit_fake_controller_manager/MoveItFakeControllerManager"/>
<!-- The rest of the params are specific to this plugin -->
<rosparam subst_value="true" file="$(find cobotx_a450_moveit)/config/fake_controllers.yaml"/>
<rosparam subst_value="true" file="$(find mercury_a1_moveit)/config/fake_controllers.yaml"/>
</launch>

View file

@ -6,5 +6,5 @@
<param name="moveit_controller_manager" value="$(arg moveit_controller_manager)"/>
<!-- loads ros_controllers to the param server -->
<rosparam file="$(find cobotx_a450_moveit)/config/ros_controllers.yaml"/>
<rosparam file="$(find mercury_a1_moveit)/config/ros_controllers.yaml"/>
</launch>

View file

@ -13,7 +13,7 @@
</include>
<!-- Set the robot urdf on the parameter server -->
<param name="robot_description" textfile="$(find mycobot_description)/urdf/myarm/myarm_urdf.urdf" />
<param name="robot_description" textfile="$(find mycobot_description)/urdf/mercury_a1/mercury_a1.urdf" />
<!-- Unpause the simulation after loading the robot model -->
<arg name="unpause" value="$(eval '' if arg('paused') else '-unpause')" />
@ -23,7 +23,7 @@
respawn="false" output="screen" />
<!-- Load the controller parameters onto the parameter server -->
<rosparam file="$(find cobotx_a450_moveit)/config/gazebo_controllers.yaml" />
<rosparam file="$(find mercury_a1_moveit)/config/gazebo_controllers.yaml" />
<include file="$(dirname)/ros_controllers.launch"/>
<!-- Spawn the Gazebo ROS controllers -->

View file

@ -0,0 +1,67 @@
<launch>
<!-- specify the planning pipeline -->
<arg name="pipeline" default="ompl" />
<!-- By default, we do not start a database (it can be large) -->
<arg name="db" default="false" />
<!-- Allow user to specify database location -->
<arg name="db_path" default="$(find mercury_a1_moveit)/default_warehouse_mongo_db" />
<!-- By default, we are not in debug mode -->
<arg name="debug" default="false" />
<!-- By default, we will load or override the robot_description -->
<arg name="load_robot_description" default="true"/>
<!-- Choose controller manager: fake, simple, or ros_control -->
<arg name="moveit_controller_manager" default="fake" />
<!-- Set execution mode for fake execution controllers -->
<arg name="fake_execution_type" default="interpolate" />
<!-- By default, hide joint_state_publisher's GUI in 'fake' controller_manager mode -->
<arg name="use_gui" default="false" />
<arg name="use_rviz" default="true" />
<!-- If needed, broadcast static tf for robot root -->
<node pkg="tf2_ros" type="static_transform_publisher" name="virtual_joint_broadcaster_0" args="0 0 0 0 0 0 world base" />
<group if="$(eval arg('moveit_controller_manager') == 'fake')">
<!-- We do not have a real robot connected, so publish fake joint states via a joint_state_publisher
MoveIt's fake controller's joint states are considered via the 'source_list' parameter -->
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" unless="$(arg use_gui)">
<rosparam param="source_list">[move_group/fake_controller_joint_states]</rosparam>
</node>
<!-- If desired, a GUI version is available allowing to move the simulated robot around manually
This corresponds to moving around the real robot without the use of MoveIt. -->
<node name="joint_state_publisher" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui" if="$(arg use_gui)">
<rosparam param="source_list">[move_group/fake_controller_joint_states]</rosparam>
</node>
<!-- Given the published joint states, publish tf for the robot links -->
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" respawn="true" output="screen" />
</group>
<!-- Run the main MoveIt executable without trajectory execution (we do not have controllers configured by default) -->
<include file="$(dirname)/move_group.launch">
<arg name="allow_trajectory_execution" value="true"/>
<arg name="moveit_controller_manager" value="$(arg moveit_controller_manager)" />
<arg name="fake_execution_type" value="$(arg fake_execution_type)"/>
<arg name="info" value="true"/>
<arg name="debug" value="$(arg debug)"/>
<arg name="pipeline" value="$(arg pipeline)"/>
<arg name="load_robot_description" value="$(arg load_robot_description)"/>
</include>
<!-- Run Rviz and load the default config to see the state of the move_group node -->
<include file="$(dirname)/moveit_rviz.launch" if="$(arg use_rviz)">
<arg name="rviz_config" value="$(dirname)/moveit.rviz"/>
<arg name="debug" value="$(arg debug)"/>
</include>
<!-- If database loading was enabled, start mongodb as well -->
<include file="$(dirname)/default_warehouse_db.launch" if="$(arg db)">
<arg name="moveit_warehouse_database_path" value="$(arg db_path)"/>
</include>
</launch>

View file

@ -5,7 +5,7 @@
<arg name="db" default="false" />
<!-- Allow user to specify database location -->
<!-- 允许用户指定数据库位置 -->
<arg name="db_path" default="$(find cobotx_a450_moveit)/default_warehouse_mongo_db" />
<arg name="db_path" default="$(find mercury_a1_moveit)/default_warehouse_mongo_db" />
<!-- By default, we are not in debug mode --> <!-- 默认情况下,我们不处于调试模式 -->
<arg name="debug" default="false" />
@ -22,7 +22,7 @@
<!-- Load the URDF, SRDF and other .yaml configuration files on the param server -->
<!-- 加载参数服务器上的URDF、SRDF等.yaml配置文件-->
<include file="$(find cobotx_a450_moveit)/launch/planning_context.launch">
<include file="$(find mercury_a1_moveit)/launch/planning_context.launch">
<arg name="load_robot_description" value="true"/>
</include>
@ -42,7 +42,7 @@
<!-- Run the main MoveIt! executable without trajectory execution (we do not have controllers configured by default) -->
<!-- 运行主MoveIt 没有轨迹执行的可执行文件(我们默认没有配置控制器)-->
<include file="$(find cobotx_a450_moveit)/launch/move_group.launch">
<include file="$(find mercury_a1_moveit)/launch/move_group.launch">
<arg name="allow_trajectory_execution" value="true"/>
<arg name="fake_execution" value="true"/>
<arg name="info" value="true"/>
@ -51,14 +51,14 @@
<!-- Run Rviz and load the default config to see the state of the move_group node -->
<!-- 运行 Rviz 并加载默认配置以查看 move_group 节点的状态 -->
<include file="$(find cobotx_a450_moveit)/launch/moveit_rviz.launch">
<include file="$(find mercury_a1_moveit)/launch/moveit_rviz.launch">
<arg name="config" value="true"/>
<arg name="debug" value="$(arg debug)"/>
</include>
<!-- If database loading was enabled, start mongodb as well -->
<!-- 如果启用了数据库加载,也启动 mongodb -->
<include file="$(find cobotx_a450_moveit)/launch/default_warehouse_db.launch" if="$(arg db)">
<include file="$(find mercury_a1_moveit)/launch/default_warehouse_db.launch" if="$(arg db)">
<arg name="moveit_warehouse_database_path" value="$(arg db_path)"/>
</include>

View file

@ -1,6 +1,6 @@
<launch>
<!-- load OMPL planning pipeline, but add the CHOMP planning adapter. -->
<include file="$(find cobotx_b450_moveit)/launch/ompl_planning_pipeline.launch.xml">
<include file="$(find mercury_a1_moveit)/launch/ompl_planning_pipeline.launch.xml">
<arg name="planning_adapters"
default="default_planner_request_adapters/LimitMaxCartesianLinkSpeed
default_planner_request_adapters/AddTimeParameterization
@ -13,7 +13,7 @@
</include>
<!-- load chomp config -->
<rosparam command="load" file="$(find cobotx_b450_moveit)/config/chomp_planning.yaml" />
<rosparam command="load" file="$(find mercury_a1_moveit)/config/chomp_planning.yaml" />
<!-- override trajectory_initialization_method: Use OMPL-generated trajectory -->
<param name="trajectory_initialization_method" value="fillTrajectory"/>

View file

@ -19,6 +19,6 @@
<param name="start_state_max_bounds_error" value="$(arg start_state_max_bounds_error)" />
<param name="jiggle_fraction" value="$(arg jiggle_fraction)" />
<rosparam command="load" file="$(find cobotx_a450_moveit)/config/ompl_planning.yaml"/>
<rosparam command="load" file="$(find mercury_a1_moveit)/config/ompl_planning.yaml"/>
</launch>

View file

@ -6,20 +6,20 @@
<arg name="robot_description" default="robot_description"/>
<!-- Load universal robot description format (URDF) -->
<param if="$(arg load_robot_description)" name="$(arg robot_description)" textfile="$(find mycobot_description)/urdf/cobotx_a450/cobotx_a450.urdf"/>
<param if="$(arg load_robot_description)" name="$(arg robot_description)" textfile="$(find mycobot_description)/urdf/mercury_a1/mercury_a1.urdf"/>
<!-- The semantic description that corresponds to the URDF -->
<param name="$(arg robot_description)_semantic" textfile="$(find cobotx_a450_moveit)/config/firefighter.srdf" />
<param name="$(arg robot_description)_semantic" textfile="$(find mercury_a1_moveit)/config/firefighter.srdf" />
<!-- Load updated joint limits (override information from URDF) -->
<group ns="$(arg robot_description)_planning">
<rosparam command="load" file="$(find cobotx_a450_moveit)/config/joint_limits.yaml"/>
<rosparam command="load" file="$(find cobotx_a450_moveit)/config/cartesian_limits.yaml"/>
<rosparam command="load" file="$(find mercury_a1_moveit)/config/joint_limits.yaml"/>
<rosparam command="load" file="$(find mercury_a1_moveit)/config/cartesian_limits.yaml"/>
</group>
<!-- Load default settings for kinematics; these settings are overridden by settings in a node's namespace -->
<group ns="$(arg robot_description)_kinematics">
<rosparam command="load" file="$(find cobotx_a450_moveit)/config/kinematics.yaml"/>
<rosparam command="load" file="$(find mercury_a1_moveit)/config/kinematics.yaml"/>
</group>

View file

@ -2,7 +2,7 @@
<launch>
<!-- Load joint controller configurations from YAML file to parameter server -->
<rosparam file="$(find cobotx_a450_moveit)/config/ros_controllers.yaml" command="load"/>
<rosparam file="$(find mercury_a1_moveit)/config/ros_controllers.yaml" command="load"/>
<!-- Load the controllers -->
<node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"

View file

@ -15,7 +15,7 @@
<!-- Start Benchmark Executable -->
<node name="$(anon moveit_benchmark)" pkg="moveit_ros_benchmarks" type="moveit_run_benchmark" args="$(arg cfg) --benchmark-planners" respawn="false" output="screen">
<rosparam command="load" file="$(find cobotx_a450_moveit)/config/ompl_planning.yaml"/>
<rosparam command="load" file="$(find mercury_a1_moveit)/config/ompl_planning.yaml"/>
</node>
</launch>

View file

@ -3,7 +3,7 @@
<!-- This file makes it easy to include the settings for sensor managers -->
<!-- Params for 3D sensors config -->
<rosparam command="load" file="$(find cobotx_b450_moveit)/config/sensors_3d.yaml" />
<rosparam command="load" file="$(find mercury_a1_moveit)/config/sensors_3d.yaml" />
<!-- Params for the octomap monitor -->
<!-- <param name="octomap_frame" type="string" value="some frame in which the robot moves" /> -->

View file

@ -8,7 +8,7 @@
<!-- Run -->
<node pkg="moveit_setup_assistant" type="moveit_setup_assistant" name="moveit_setup_assistant"
args="--config_pkg=cobotx_b450_moveit"
args="--config_pkg=mercury_a1_moveit"
launch-prefix="$(arg launch_prefix)"
required="true"
output="screen" />

View file

@ -3,6 +3,6 @@
<param name="moveit_controller_manager" value="moveit_simple_controller_manager/MoveItSimpleControllerManager" />
<!-- Load controller list to the parameter server -->
<rosparam file="$(find cobotx_b450_moveit)/config/simple_moveit_controllers.yaml" />
<rosparam file="$(find cobotx_b450_moveit)/config/ros_controllers.yaml" />
<rosparam file="$(find mercury_a1_moveit)/config/simple_moveit_controllers.yaml" />
<rosparam file="$(find mercury_a1_moveit)/config/ros_controllers.yaml" />
</launch>

View file

@ -19,5 +19,5 @@
<param name="start_state_max_bounds_error" value="$(arg start_state_max_bounds_error)" />
<param name="jiggle_fraction" value="$(arg jiggle_fraction)" />
<rosparam command="load" file="$(find cobotx_b450_moveit)/config/stomp_planning.yaml"/>
<rosparam command="load" file="$(find mercury_a1_moveit)/config/stomp_planning.yaml"/>
</launch>

View file

@ -1,6 +1,6 @@
<package>
<name>cobotx_a450_moveit</name>
<name>mercury_a1_moveit</name>
<version>0.3.0</version>
<description>
An automatically generated package with all the configuration and launch files for using the firefighter with the MoveIt Motion Planning Framework

View file

@ -13,7 +13,7 @@ import math
import rospy
from sensor_msgs.msg import JointState
from pymycobot.cobotx import CobotX
from pymycobot.mercury import Mercury
mc = None
@ -21,10 +21,12 @@ mc = None
def callback(data):
# rospy.loginfo(rospy.get_caller_id() + "%s", data.position)
print(data.position)
# print(data.position)
rounded_data_tuple = tuple(round(value, 2) for value in data.position)
rospy.loginfo(rospy.get_caller_id() + "%s", rounded_data_tuple)
data_list = []
for index, value in enumerate(data.position):
radians_to_angles = math.degrees(value)
radians_to_angles = round(math.degrees(value), 2)
data_list.append(radians_to_angles)
# mc.send_radians(data_list, 80)
@ -40,7 +42,7 @@ def listener():
port = rospy.get_param("~port", "/dev/ttyAMA1")
baud = rospy.get_param("~baud", 115200)
print(port, baud)
mc = CobotX(port, baud)
mc = Mercury(port, baud)
# spin() simply keeps python from exiting until this node is stopped
# spin()只是阻止python退出直到该节点停止

View file

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 2.8.3)
project(cobotx_b450)
project(mercury_b1)
add_compile_options(-std=c++11)
## Find catkin and any catkin packages

View file

@ -1,7 +1,7 @@
<launch>
<!-- Load URDF file,加载URDF文件 -->
<arg name="model" default="$(find mycobot_description)/urdf/cobotx_b450/cobotx_b450.urdf"/>
<arg name="rvizconfig" default="$(find cobotx_b450)/config/cobotx_b450.rviz" />
<arg name="model" default="$(find mycobot_description)/urdf/mercury_b1/mercury_b1.urdf"/>
<arg name="rvizconfig" default="$(find mercury_b1)/config/mercury_b1.rviz" />
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
<!-- Combinejoin values to TF 将值合并到TF-->

View file

@ -3,8 +3,8 @@
<arg name="port" default="/dev/ttyAMA1" />
<arg name="baud" default="115200" />
<arg name="model" default="$(find mycobot_description)/urdf/cobotx_a450/cobotx_a450.urdf"/>
<arg name="rvizconfig" default="$(find cobotx_a450)/config/cobotx_a450.rviz" />
<arg name="model" default="$(find mycobot_description)/urdf/mercury_a1/mercury_a1.urdf"/>
<arg name="rvizconfig" default="$(find mercury_a1)/config/mercury_a1.rviz" />
<arg name="gui" default="false" />
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
@ -14,10 +14,10 @@
<!-- Show in Rviz 显示在Rviz-->
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />
<include file="$(find cobotx_a450_communication)/launch/communication_service.launch">
<include file="$(find mercury_a1_communication)/launch/communication_service.launch">
<arg name="port" value="$(arg port)" />
<arg name="baud" value="$(arg baud)" />
</include>
<node name="real_listener" pkg="cobotx_a450" type="listen_real.py" />
<node name="simple_gui" pkg="cobotx_a450" type="simple_gui.py" />
<node name="real_listener" pkg="mercury_a1" type="listen_real.py" />
<node name="simple_gui" pkg="mercury_a1" type="simple_gui.py" />
</launch>

View file

@ -2,8 +2,8 @@
<!-- <arg name="port" default="/dev/ttyUSB0" />
<arg name="baud" default="115200" /> -->
<!-- Load file model ,加载文件模型-->
<arg name="model" default="$(find mycobot_description)/urdf/cobotx_a450/cobotx_a450.urdf"/>
<arg name="rvizconfig" default="$(find cobotx_a450)/config/cobotx_a450.rviz" />
<arg name="model" default="$(find mycobot_description)/urdf/mercury_b1/mercury_b1.urdf"/>
<arg name="rvizconfig" default="$(find mercury_b1)/config/mercury_b1.rviz" />
<arg name="gui" default="true" />
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />

Some files were not shown because too many files have changed in this diff Show more