-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #126 from elephantrobotics/cobotx_b450
Cobotx b450
- Loading branch information
Showing
184 changed files
with
18,340 additions
and
155 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
CobotX/cobotx_a450/CMakeLists.txt → Mercury/mercury_a1/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions
4
.../cobotx_a450/launch/mycobot_follow.launch → ...y/mercury_a1/launch/mycobot_follow.launch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
CobotX/cobotx_a450/launch/test.launch → Mercury/mercury_a1/launch/test.launch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
<?xml version="1.0"?> | ||
<package format="2"> | ||
<name>cobotx_a450</name> | ||
<name>mercury_a1</name> | ||
<version>0.3.0</version> | ||
<description>The cobotx_a450 package</description> | ||
<description>The mercury_a1 package</description> | ||
|
||
<author email="[email protected]">Wangweijian</author> | ||
<maintainer email="[email protected]">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 --> | ||
|
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
#!/usr/bin/env python3 | ||
# encoding:utf-8 | ||
|
||
import math | ||
import rospy | ||
from sensor_msgs.msg import JointState | ||
from std_msgs.msg import Header | ||
from mercury_a1_communication.msg import MercuryAngles | ||
|
||
|
||
class Listener(object): | ||
def __init__(self): | ||
super(Listener, self).__init__() | ||
|
||
rospy.loginfo("start ...") | ||
rospy.init_node("real_listener_1", anonymous=True) | ||
# init publisher.初始化发布者 | ||
self.pub = rospy.Publisher("joint_states", JointState, queue_size=10) | ||
# init subscriber.初始化订阅者 | ||
self.sub = rospy.Subscriber("myarm/angles_real", MercuryAngles, self.callback) | ||
rospy.spin() | ||
|
||
def callback(self, data): | ||
"""`mercury/angles_real` subscriber callback method. | ||
Args: | ||
data (MercuryAngles): callback argument. | ||
""" | ||
# ini publisher object. 初始化发布者对象 | ||
joint_state_send = JointState() | ||
joint_state_send.header = Header() | ||
|
||
joint_state_send.name = [ | ||
"joint1_to_base", | ||
"joint2_to_joint1", | ||
"joint3_to_joint2", | ||
"joint4_to_joint3", | ||
"joint5_to_joint4", | ||
"joint6_to_joint5", | ||
"joint7_to_joint6", | ||
] | ||
joint_state_send.velocity = [0] | ||
joint_state_send.effort = [] | ||
joint_state_send.header.stamp = rospy.Time.now() | ||
|
||
# process callback data. 处理回调数据。 | ||
radians_list = [ | ||
data.joint_1 * (math.pi / 180), | ||
data.joint_2 * (math.pi / 180), | ||
data.joint_3 * (math.pi / 180), | ||
data.joint_4 * (math.pi / 180), | ||
data.joint_5 * (math.pi / 180), | ||
data.joint_6 * (math.pi / 180), | ||
data.joint_7 * (math.pi / 180), | ||
] | ||
rospy.loginfo("res: {}".format(radians_list)) | ||
|
||
joint_state_send.position = radians_list | ||
self.pub.publish(joint_state_send) | ||
|
||
|
||
if __name__ == "__main__": | ||
try: | ||
Listener() | ||
except rospy.ROSInterruptException: | ||
pass |
Oops, something went wrong.