diff --git a/mycobot_280/mycobot_280jn/config/mycobot.rviz b/mycobot_280/mycobot_280jn/config/mycobot_jn.rviz similarity index 78% rename from mycobot_280/mycobot_280jn/config/mycobot.rviz rename to mycobot_280/mycobot_280jn/config/mycobot_jn.rviz index 51ba33e..a3590c8 100644 --- a/mycobot_280/mycobot_280jn/config/mycobot.rviz +++ b/mycobot_280/mycobot_280jn/config/mycobot_jn.rviz @@ -9,7 +9,7 @@ Panels: - /RobotModel1 - /TF1 Splitter Ratio: 0.5 - Tree Height: 775 + Tree Height: 579 - Class: rviz/Selection Name: Selection - Class: rviz/Tool Properties @@ -18,17 +18,18 @@ Panels: - /2D Nav Goal1 - /Publish Point1 Name: Tool Properties - Splitter Ratio: 0.588679016 + Splitter Ratio: 0.5886790156364441 - Class: rviz/Views Expanded: - /Current View1 Name: Views Splitter Ratio: 0.5 - Class: rviz/Time - Experimental: false Name: Time SyncMode: 0 SyncSource: "" +Preferences: + PromptSaveOnExit: true Toolbars: toolButtonStyle: 2 Visualization Manager: @@ -40,7 +41,7 @@ Visualization Manager: Color: 160; 160; 164 Enabled: true Line Style: - Line Width: 0.0299999993 + Line Width: 0.029999999329447746 Value: Lines Name: Grid Normal Cell Count: 0 @@ -122,7 +123,8 @@ Visualization Manager: Value: true joint6_flange: Value: true - Marker Scale: 0.300000012 + Marker Alpha: 1 + Marker Scale: 0.30000001192092896 Name: TF Show Arrows: true Show Axes: true @@ -153,7 +155,10 @@ Visualization Manager: - Class: rviz/FocusCamera - Class: rviz/Measure - Class: rviz/SetInitialPose + Theta std deviation: 0.2617993950843811 Topic: /initialpose + X std deviation: 0.5 + Y std deviation: 0.5 - Class: rviz/SetGoal Topic: /move_base_simple/goal - Class: rviz/PublishPoint @@ -163,33 +168,33 @@ Visualization Manager: Views: Current: Class: rviz/Orbit - Distance: 1.20289087 + Distance: 1.2028908729553223 Enable Stereo Rendering: - Stereo Eye Separation: 0.0599999987 + Stereo Eye Separation: 0.05999999865889549 Stereo Focal Distance: 1 Swap Stereo Eyes: false Value: false + Field of View: 0.7853981852531433 Focal Point: - X: -0.0706475973 - Y: -0.0814988762 - Z: 0.107583851 + X: -0.07064759731292725 + Y: -0.0814988762140274 + Z: 0.10758385062217712 Focal Shape Fixed Size: true - Focal Shape Size: 0.0500000007 + Focal Shape Size: 0.05000000074505806 Invert Z Axis: false Name: Current View - Near Clip Distance: 0.00999999978 - Pitch: 0.440398335 + Near Clip Distance: 0.009999999776482582 + Pitch: 0.44039833545684814 Target Frame: - Value: Orbit (rviz) - Yaw: 0.430389732 + Yaw: 0.43038973212242126 Saved: ~ Window Geometry: Displays: collapsed: false - Height: 1056 + Height: 876 Hide Left Dock: false Hide Right Dock: false - QMainWindow State: 000000ff00000000fd00000004000000000000016a00000396fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006100fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000002800000396000000d700fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000022f00000396fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000002800000396000000ad00fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073f0000003efc0100000002fb0000000800540069006d006501000000000000073f0000030000fffffffb0000000800540069006d006501000000000000045000000000000000000000039a0000039600000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + QMainWindow State: 000000ff00000000fd00000004000000000000016a000002cefc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d000002ce000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000022f000002cefc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d000002ce000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000007380000003efc0100000002fb0000000800540069006d0065010000000000000738000003bc00fffffffb0000000800540069006d0065010000000000000450000000000000000000000393000002ce00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 Selection: collapsed: false Time: @@ -198,6 +203,6 @@ Window Geometry: collapsed: false Views: collapsed: false - Width: 1855 - X: 65 - Y: 24 + Width: 1848 + X: 72 + Y: 27 diff --git a/mycobot_280/mycobot_280jn/launch/detect_marker.launch b/mycobot_280/mycobot_280jn/launch/detect_marker.launch index 444638e..c41a96f 100644 --- a/mycobot_280/mycobot_280jn/launch/detect_marker.launch +++ b/mycobot_280/mycobot_280jn/launch/detect_marker.launch @@ -1,7 +1,7 @@ - + diff --git a/mycobot_280/mycobot_280jn/launch/detect_marker_with_topic.launch b/mycobot_280/mycobot_280jn/launch/detect_marker_with_topic.launch index 2bba726..c4222af 100644 --- a/mycobot_280/mycobot_280jn/launch/detect_marker_with_topic.launch +++ b/mycobot_280/mycobot_280jn/launch/detect_marker_with_topic.launch @@ -4,7 +4,7 @@ - + diff --git a/mycobot_280/mycobot_280jn/launch/mycobot_follow.launch b/mycobot_280/mycobot_280jn/launch/mycobot_follow.launch index 7511e1f..f5c89e8 100644 --- a/mycobot_280/mycobot_280jn/launch/mycobot_follow.launch +++ b/mycobot_280/mycobot_280jn/launch/mycobot_follow.launch @@ -1,7 +1,7 @@ - + diff --git a/mycobot_280/mycobot_280jn/launch/simple_gui.launch b/mycobot_280/mycobot_280jn/launch/simple_gui.launch index d1b31e0..79c92ee 100644 --- a/mycobot_280/mycobot_280jn/launch/simple_gui.launch +++ b/mycobot_280/mycobot_280jn/launch/simple_gui.launch @@ -1,10 +1,10 @@ - - + + - + @@ -14,9 +14,9 @@ - - + + diff --git a/mycobot_280/mycobot_280jn/launch/slider_control.launch b/mycobot_280/mycobot_280jn/launch/slider_control.launch index ac42e42..63fdaa3 100644 --- a/mycobot_280/mycobot_280jn/launch/slider_control.launch +++ b/mycobot_280/mycobot_280jn/launch/slider_control.launch @@ -3,7 +3,7 @@ --> - + diff --git a/mycobot_280/mycobot_280jn/launch/teleop_keyboard.launch b/mycobot_280/mycobot_280jn/launch/teleop_keyboard.launch index f3a84db..d915aae 100644 --- a/mycobot_280/mycobot_280jn/launch/teleop_keyboard.launch +++ b/mycobot_280/mycobot_280jn/launch/teleop_keyboard.launch @@ -1,10 +1,10 @@ - - + + - + @@ -14,9 +14,9 @@ - - + + diff --git a/mycobot_280/mycobot_280jn/launch/test.launch b/mycobot_280/mycobot_280jn/launch/test.launch index dbb1f00..4fa06e4 100644 --- a/mycobot_280/mycobot_280jn/launch/test.launch +++ b/mycobot_280/mycobot_280jn/launch/test.launch @@ -1,14 +1,14 @@ - - + + - + diff --git a/mycobot_280/mycobot_280jn/scripts/follow_display.py b/mycobot_280/mycobot_280jn/scripts/follow_display.py index 52d18b7..68e8095 100755 --- a/mycobot_280/mycobot_280jn/scripts/follow_display.py +++ b/mycobot_280/mycobot_280jn/scripts/follow_display.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # encoding:utf8 import time @@ -15,16 +15,16 @@ def talker(): rospy.init_node("display", anonymous=True) print("Try connect real mycobot...") - # port = rospy.get_param("~port", "/dev/ttyTHS1") - # baud = rospy.get_param("~baud", 1000000) - ip=rospy.get_param('~ip','192.168.125.226') - netport=rospy.get_param('~netport',9000) - # print("port: {}, baud: {}\n".format(port, baud)) - print('ip:{},port:{}'.format(ip,netport)) + port = rospy.get_param("~port", "/dev/ttyTHS1") + baud = rospy.get_param("~baud", 1000000) + # ip=rospy.get_param('~ip','192.168.125.226') + # netport=rospy.get_param('~netport',9000) + print("port: {}, baud: {}\n".format(port, baud)) + # print('ip:{},port:{}'.format(ip,netport)) try: - # mycobot = MyCobot(port, baud) - mycobot=MyCobotSocket(ip,netport) - mycobot.connect() + mycobot = MyCobot(port, baud) + # mycobot=MyCobotSocket(ip,netport) + # mycobot.connect() except Exception as e: print(e) print( diff --git a/mycobot_280/mycobot_280jn/scripts/listen_real.py b/mycobot_280/mycobot_280jn/scripts/listen_real.py index 1d38b61..aea0d53 100755 --- a/mycobot_280/mycobot_280jn/scripts/listen_real.py +++ b/mycobot_280/mycobot_280jn/scripts/listen_real.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # encoding:utf-8 # license removed for brevity import time diff --git a/mycobot_280/mycobot_280jn/scripts/listen_real_of_topic.py b/mycobot_280/mycobot_280jn/scripts/listen_real_of_topic.py index ea3df92..89f9430 100755 --- a/mycobot_280/mycobot_280jn/scripts/listen_real_of_topic.py +++ b/mycobot_280/mycobot_280jn/scripts/listen_real_of_topic.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 import math import rospy diff --git a/mycobot_280/mycobot_280jn/scripts/simple_gui.py b/mycobot_280/mycobot_280jn/scripts/simple_gui.py index 9f4c791..41f9258 100755 --- a/mycobot_280/mycobot_280jn/scripts/simple_gui.py +++ b/mycobot_280/mycobot_280jn/scripts/simple_gui.py @@ -1,6 +1,7 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # -*- coding: utf-8 -*- -import Tkinter as tk +# import Tkinter as tk +import tkinter as tk from mycobot_communication.srv import GetCoords, SetCoords, GetAngles, SetAngles, GripperStatus import rospy import time @@ -33,7 +34,7 @@ class Window: # 计算 Tk 根窗口的 x 和 y 坐标 x = (self.ws / 2) - 190 y = (self.hs / 2) - 250 - self.win.geometry("430x370+{}+{}".format(x, y)) + self.win.geometry("430x400+{}+{}".format(int(x), int(y))) # layout,布局 self.set_layout() # input section,输入部分 diff --git a/mycobot_280/mycobot_280jn/scripts/slider_control.py b/mycobot_280/mycobot_280jn/scripts/slider_control.py index 4bf44b9..bf58aae 100755 --- a/mycobot_280/mycobot_280jn/scripts/slider_control.py +++ b/mycobot_280/mycobot_280jn/scripts/slider_control.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # encoding:utf-8 """[summary] This file obtains the joint angle of the manipulator in ROS, @@ -16,7 +16,7 @@ from pymycobot.mycobot import MyCobot from pymycobot.mycobotsocket import MyCobotSocket -ms = None +mc = None def callback(data): @@ -26,24 +26,24 @@ def callback(data): for index, value in enumerate(data.position): data_list.append(value) - ms.send_radians(data_list, 80) + mc.send_radians(data_list, 80) # time.sleep(0.5) def listener(): - global ms + global mc rospy.init_node("control_slider", anonymous=True) rospy.Subscriber("joint_states", JointState, callback) - # port = rospy.get_param("~port", "/dev/ttyTHS1") - # baud = rospy.get_param("~baud", 1000000) - # print(port, baud) - # mc = MyCobot(port, baud) - ip=rospy.get_param("~ip",'192.168.125.226') - port=rospy.get_param("~port",9000) - print(ip,port) - ms=MyCobotSocket(ip,port) - ms.connect() + port = rospy.get_param("~port", "/dev/ttyTHS1") + baud = rospy.get_param("~baud", 1000000) + print(port, baud) + mc = MyCobot(port, baud) + # ip=rospy.get_param("~ip",'192.168.125.226') + # port=rospy.get_param("~port",9000) + # print(ip,port) + # ms=MyCobotSocket(ip,port) + # ms.connect() # spin() simply keeps python from exiting until this node is stopped # spin()只是阻止python退出,直到该节点停止 diff --git a/mycobot_280/mycobot_280jn/scripts/teleop_keyboard.py b/mycobot_280/mycobot_280jn/scripts/teleop_keyboard.py index e5ee716..110f8a4 100755 --- a/mycobot_280/mycobot_280jn/scripts/teleop_keyboard.py +++ b/mycobot_280/mycobot_280jn/scripts/teleop_keyboard.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/env python3 # encoding=utf-8 from __future__ import print_function from mycobot_communication.srv import GetCoords, SetCoords, GetAngles, SetAngles, GripperStatus diff --git a/mycobot_communication/launch/communication_jsnn.launch b/mycobot_communication/launch/communication_jsnn.launch index b49eba0..3472501 100644 --- a/mycobot_communication/launch/communication_jsnn.launch +++ b/mycobot_communication/launch/communication_jsnn.launch @@ -1,10 +1,10 @@ - - + + - + diff --git a/mycobot_communication/scripts/mycobot_services.py b/mycobot_communication/scripts/mycobot_services.py index 0f105a8..1f5c89a 100755 --- a/mycobot_communication/scripts/mycobot_services.py +++ b/mycobot_communication/scripts/mycobot_services.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python2 +#!/usr/bin/env python3 # -*- coding: utf-8 -* import time import rospy