mirror of
https://github.com/elephantrobotics/mycobot_ros.git
synced 2026-07-14 17:11:09 +00:00
update ubuntu20.04 280_jn ros1
This commit is contained in:
parent
a7f592229b
commit
3b36203762
16 changed files with 76 additions and 70 deletions
|
|
@ -9,7 +9,7 @@ Panels:
|
||||||
- /RobotModel1
|
- /RobotModel1
|
||||||
- /TF1
|
- /TF1
|
||||||
Splitter Ratio: 0.5
|
Splitter Ratio: 0.5
|
||||||
Tree Height: 775
|
Tree Height: 579
|
||||||
- Class: rviz/Selection
|
- Class: rviz/Selection
|
||||||
Name: Selection
|
Name: Selection
|
||||||
- Class: rviz/Tool Properties
|
- Class: rviz/Tool Properties
|
||||||
|
|
@ -18,17 +18,18 @@ Panels:
|
||||||
- /2D Nav Goal1
|
- /2D Nav Goal1
|
||||||
- /Publish Point1
|
- /Publish Point1
|
||||||
Name: Tool Properties
|
Name: Tool Properties
|
||||||
Splitter Ratio: 0.588679016
|
Splitter Ratio: 0.5886790156364441
|
||||||
- Class: rviz/Views
|
- Class: rviz/Views
|
||||||
Expanded:
|
Expanded:
|
||||||
- /Current View1
|
- /Current View1
|
||||||
Name: Views
|
Name: Views
|
||||||
Splitter Ratio: 0.5
|
Splitter Ratio: 0.5
|
||||||
- Class: rviz/Time
|
- Class: rviz/Time
|
||||||
Experimental: false
|
|
||||||
Name: Time
|
Name: Time
|
||||||
SyncMode: 0
|
SyncMode: 0
|
||||||
SyncSource: ""
|
SyncSource: ""
|
||||||
|
Preferences:
|
||||||
|
PromptSaveOnExit: true
|
||||||
Toolbars:
|
Toolbars:
|
||||||
toolButtonStyle: 2
|
toolButtonStyle: 2
|
||||||
Visualization Manager:
|
Visualization Manager:
|
||||||
|
|
@ -40,7 +41,7 @@ Visualization Manager:
|
||||||
Color: 160; 160; 164
|
Color: 160; 160; 164
|
||||||
Enabled: true
|
Enabled: true
|
||||||
Line Style:
|
Line Style:
|
||||||
Line Width: 0.0299999993
|
Line Width: 0.029999999329447746
|
||||||
Value: Lines
|
Value: Lines
|
||||||
Name: Grid
|
Name: Grid
|
||||||
Normal Cell Count: 0
|
Normal Cell Count: 0
|
||||||
|
|
@ -122,7 +123,8 @@ Visualization Manager:
|
||||||
Value: true
|
Value: true
|
||||||
joint6_flange:
|
joint6_flange:
|
||||||
Value: true
|
Value: true
|
||||||
Marker Scale: 0.300000012
|
Marker Alpha: 1
|
||||||
|
Marker Scale: 0.30000001192092896
|
||||||
Name: TF
|
Name: TF
|
||||||
Show Arrows: true
|
Show Arrows: true
|
||||||
Show Axes: true
|
Show Axes: true
|
||||||
|
|
@ -153,7 +155,10 @@ Visualization Manager:
|
||||||
- Class: rviz/FocusCamera
|
- Class: rviz/FocusCamera
|
||||||
- Class: rviz/Measure
|
- Class: rviz/Measure
|
||||||
- Class: rviz/SetInitialPose
|
- Class: rviz/SetInitialPose
|
||||||
|
Theta std deviation: 0.2617993950843811
|
||||||
Topic: /initialpose
|
Topic: /initialpose
|
||||||
|
X std deviation: 0.5
|
||||||
|
Y std deviation: 0.5
|
||||||
- Class: rviz/SetGoal
|
- Class: rviz/SetGoal
|
||||||
Topic: /move_base_simple/goal
|
Topic: /move_base_simple/goal
|
||||||
- Class: rviz/PublishPoint
|
- Class: rviz/PublishPoint
|
||||||
|
|
@ -163,33 +168,33 @@ Visualization Manager:
|
||||||
Views:
|
Views:
|
||||||
Current:
|
Current:
|
||||||
Class: rviz/Orbit
|
Class: rviz/Orbit
|
||||||
Distance: 1.20289087
|
Distance: 1.2028908729553223
|
||||||
Enable Stereo Rendering:
|
Enable Stereo Rendering:
|
||||||
Stereo Eye Separation: 0.0599999987
|
Stereo Eye Separation: 0.05999999865889549
|
||||||
Stereo Focal Distance: 1
|
Stereo Focal Distance: 1
|
||||||
Swap Stereo Eyes: false
|
Swap Stereo Eyes: false
|
||||||
Value: false
|
Value: false
|
||||||
|
Field of View: 0.7853981852531433
|
||||||
Focal Point:
|
Focal Point:
|
||||||
X: -0.0706475973
|
X: -0.07064759731292725
|
||||||
Y: -0.0814988762
|
Y: -0.0814988762140274
|
||||||
Z: 0.107583851
|
Z: 0.10758385062217712
|
||||||
Focal Shape Fixed Size: true
|
Focal Shape Fixed Size: true
|
||||||
Focal Shape Size: 0.0500000007
|
Focal Shape Size: 0.05000000074505806
|
||||||
Invert Z Axis: false
|
Invert Z Axis: false
|
||||||
Name: Current View
|
Name: Current View
|
||||||
Near Clip Distance: 0.00999999978
|
Near Clip Distance: 0.009999999776482582
|
||||||
Pitch: 0.440398335
|
Pitch: 0.44039833545684814
|
||||||
Target Frame: <Fixed Frame>
|
Target Frame: <Fixed Frame>
|
||||||
Value: Orbit (rviz)
|
Yaw: 0.43038973212242126
|
||||||
Yaw: 0.430389732
|
|
||||||
Saved: ~
|
Saved: ~
|
||||||
Window Geometry:
|
Window Geometry:
|
||||||
Displays:
|
Displays:
|
||||||
collapsed: false
|
collapsed: false
|
||||||
Height: 1056
|
Height: 876
|
||||||
Hide Left Dock: false
|
Hide Left Dock: false
|
||||||
Hide Right Dock: false
|
Hide Right Dock: false
|
||||||
QMainWindow State: 000000ff00000000fd00000004000000000000016a00000396fc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000006100fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000002800000396000000d700fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000022f00000396fc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000002800000396000000ad00fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e100000197000000030000073f0000003efc0100000002fb0000000800540069006d006501000000000000073f0000030000fffffffb0000000800540069006d006501000000000000045000000000000000000000039a0000039600000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
|
QMainWindow State: 000000ff00000000fd00000004000000000000016a000002cefc0200000008fb0000001200530065006c0065006300740069006f006e00000001e10000009b0000005c00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000003d000002ce000000c900fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261000000010000022f000002cefc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000003d000002ce000000a400fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000007380000003efc0100000002fb0000000800540069006d0065010000000000000738000003bc00fffffffb0000000800540069006d0065010000000000000450000000000000000000000393000002ce00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
|
||||||
Selection:
|
Selection:
|
||||||
collapsed: false
|
collapsed: false
|
||||||
Time:
|
Time:
|
||||||
|
|
@ -198,6 +203,6 @@ Window Geometry:
|
||||||
collapsed: false
|
collapsed: false
|
||||||
Views:
|
Views:
|
||||||
collapsed: false
|
collapsed: false
|
||||||
Width: 1855
|
Width: 1848
|
||||||
X: 65
|
X: 72
|
||||||
Y: 24
|
Y: 27
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<launch>
|
<launch>
|
||||||
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
||||||
<arg name="model" default="$(find mycobot_description)/urdf/280jn/mycobot_urdf.urdf"/>
|
<arg name="model" default="$(find mycobot_description)/urdf/280jn/mycobot_urdf.urdf"/>
|
||||||
<arg name="rvizconfig" default="$(find mycobot_280jn)/config/mycobot_with_marker.rviz" />
|
<arg name="rvizconfig" default="$(find mycobot_280)/config/mycobot_with_marker.rviz" />
|
||||||
<arg name="gui" default="true" />
|
<arg name="gui" default="true" />
|
||||||
|
|
||||||
<arg name="num" default="0" />
|
<arg name="num" default="0" />
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
<arg name="baud" default="1000000" />
|
<arg name="baud" default="1000000" />
|
||||||
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
||||||
<arg name="model" default="$(find mycobot_description)/urdf/280jn/mycobot_urdf.urdf"/>
|
<arg name="model" default="$(find mycobot_description)/urdf/280jn/mycobot_urdf.urdf"/>
|
||||||
<arg name="rvizconfig" default="$(find mycobot_280jn)/config/mycobot_with_marker.rviz" />
|
<arg name="rvizconfig" default="$(find mycobot_280)/config/mycobot_with_marker.rviz" />
|
||||||
<arg name="gui" default="false" />
|
<arg name="gui" default="false" />
|
||||||
|
|
||||||
<arg name="num" default="0" />
|
<arg name="num" default="0" />
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
<launch>
|
<launch>
|
||||||
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
||||||
<arg name="model" default="$(find mycobot_description)/urdf/280jn/mycobot_urdf.urdf"/>
|
<arg name="model" default="$(find mycobot_description)/urdf/280jn/mycobot_urdf.urdf"/>
|
||||||
<arg name="rvizconfig" default="$(find mycobot_280jn)/config/mycobot.rviz" />
|
<arg name="rvizconfig" default="$(find mycobot_280jn)/config/mycobot_jn.rviz" />
|
||||||
|
|
||||||
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
|
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
|
||||||
<!-- mycobot-topics,mycobot-话题 -->
|
<!-- mycobot-topics,mycobot-话题 -->
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
<launch>
|
<launch>
|
||||||
<!-- Select connecting device and serial port ,选择连接设备及串口-->
|
<!-- Select connecting device and serial port ,选择连接设备及串口-->
|
||||||
<arg name="ip" default="192.168.125.226" />
|
<arg name="port" default="/dev/ttyTHS1" />
|
||||||
<arg name="port" default="9000" />
|
<arg name="baud" default="1000000" />
|
||||||
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
||||||
<arg name="model" default="$(find mycobot_description)/urdf/280jn/mycobot_urdf.urdf"/>
|
<arg name="model" default="$(find mycobot_description)/urdf/280jn/mycobot_urdf.urdf"/>
|
||||||
<arg name="rvizconfig" default="$(find mycobot_280jn)/config/mycobot.rviz" />
|
<arg name="rvizconfig" default="$(find mycobot_280jn)/config/mycobot_jn.rviz" />
|
||||||
<arg name="gui" default="false" />
|
<arg name="gui" default="false" />
|
||||||
|
|
||||||
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
|
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
|
||||||
|
|
@ -14,9 +14,9 @@
|
||||||
<!-- Show in Rviz ,显示在Rviz-->
|
<!-- Show in Rviz ,显示在Rviz-->
|
||||||
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />
|
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />
|
||||||
|
|
||||||
<include file="$(find mycobot_communication)/launch/communication_service.launch">
|
<include file="$(find mycobot_communication)/launch/communication_jsnn.launch">
|
||||||
<arg name="ip" value="$(arg ip)" />
|
|
||||||
<arg name="port" value="$(arg port)" />
|
<arg name="port" value="$(arg port)" />
|
||||||
|
<arg name="baud" value="$(arg baud)" />
|
||||||
</include>
|
</include>
|
||||||
<!-- listen and pub the real angles ,监听并发布真实的角度-->
|
<!-- listen and pub the real angles ,监听并发布真实的角度-->
|
||||||
<node name="real_listener" pkg="mycobot_280jn" type="listen_real.py" />
|
<node name="real_listener" pkg="mycobot_280jn" type="listen_real.py" />
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
<arg name="baud" default="1000000" /> -->
|
<arg name="baud" default="1000000" /> -->
|
||||||
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
||||||
<arg name="model" default="$(find mycobot_description)/urdf/280jn/mycobot_urdf.urdf"/>
|
<arg name="model" default="$(find mycobot_description)/urdf/280jn/mycobot_urdf.urdf"/>
|
||||||
<arg name="rvizconfig" default="$(find mycobot_280jn)/config/mycobot.rviz" />
|
<arg name="rvizconfig" default="$(find mycobot_280jn)/config/mycobot_jn.rviz" />
|
||||||
<arg name="gui" default="true" />
|
<arg name="gui" default="true" />
|
||||||
|
|
||||||
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
|
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
<launch>
|
<launch>
|
||||||
<!-- Select connecting device and serial port ,选择连接设备及串口-->
|
<!-- Select connecting device and serial port ,选择连接设备及串口-->
|
||||||
<arg name="ip" default="192.168.125.226" />
|
<arg name="port" default="/dev/ttyTHS1" />
|
||||||
<arg name="port" default="9000" />
|
<arg name="baud" default="1000000" />
|
||||||
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
||||||
<arg name="model" default="$(find mycobot_description)/urdf/280jn/mycobot_urdf.urdf"/>
|
<arg name="model" default="$(find mycobot_description)/urdf/280jn/mycobot_urdf.urdf"/>
|
||||||
<arg name="rvizconfig" default="$(find mycobot_280jn)/config/mycobot.rviz" />
|
<arg name="rvizconfig" default="$(find mycobot_280jn)/config/mycobot_jn.rviz" />
|
||||||
<arg name="gui" default="false" />
|
<arg name="gui" default="false" />
|
||||||
|
|
||||||
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
|
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
|
||||||
|
|
@ -14,9 +14,9 @@
|
||||||
<!-- Show in Rviz ,显示在Rviz-->
|
<!-- Show in Rviz ,显示在Rviz-->
|
||||||
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />
|
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />
|
||||||
|
|
||||||
<include file="$(find mycobot_communication)/launch/communication_service.launch">
|
<include file="$(find mycobot_communication)/launch/communication_jsnn.launch">
|
||||||
<arg name="ip" value="$(arg ip)" />
|
|
||||||
<arg name="port" value="$(arg port)" />
|
<arg name="port" value="$(arg port)" />
|
||||||
|
<arg name="baud" value="$(arg baud)" />
|
||||||
</include>
|
</include>
|
||||||
<!-- listen and pub the real angles ,监听并发布真实的角度-->
|
<!-- listen and pub the real angles ,监听并发布真实的角度-->
|
||||||
<node name="real_listener" pkg="mycobot_280jn" type="listen_real.py" />
|
<node name="real_listener" pkg="mycobot_280jn" type="listen_real.py" />
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
<launch>
|
<launch>
|
||||||
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
||||||
<arg name="model" default="$(find mycobot_description)/urdf/mycobot/mycobot_with_vision.urdf"/>
|
<arg name="model" default="$(find mycobot_description)/urdf/280jn/mycobot_urdf.urdf"/>
|
||||||
<arg name="rvizconfig" default="$(find mycobot_280)/config/mycobot.rviz" />
|
<arg name="rvizconfig" default="$(find mycobot_280jn)/config/mycobot_jn.rviz" />
|
||||||
<arg name="gui" default="true" />
|
<arg name="gui" default="true" />
|
||||||
|
|
||||||
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
|
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
|
||||||
|
|
||||||
<!-- Combinejoin values to TF ,将值合并到TF-->
|
<!-- Combinejoin values to TF ,将值合并到TF-->
|
||||||
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
|
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
|
||||||
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
|
<node name="joint_state_publisher_gui" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui">
|
||||||
<param name="use_gui" value="$(arg gui)" />
|
<param name="use_gui" value="$(arg gui)" />
|
||||||
<!-- <rosparam param="source_list" subst_value="true">["joint_states"]</rosparam> -->
|
<!-- <rosparam param="source_list" subst_value="true">["joint_states"]</rosparam> -->
|
||||||
</node>
|
</node>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
# encoding:utf8
|
# encoding:utf8
|
||||||
import time
|
import time
|
||||||
|
|
||||||
|
|
@ -15,16 +15,16 @@ def talker():
|
||||||
rospy.init_node("display", anonymous=True)
|
rospy.init_node("display", anonymous=True)
|
||||||
|
|
||||||
print("Try connect real mycobot...")
|
print("Try connect real mycobot...")
|
||||||
# port = rospy.get_param("~port", "/dev/ttyTHS1")
|
port = rospy.get_param("~port", "/dev/ttyTHS1")
|
||||||
# baud = rospy.get_param("~baud", 1000000)
|
baud = rospy.get_param("~baud", 1000000)
|
||||||
ip=rospy.get_param('~ip','192.168.125.226')
|
# ip=rospy.get_param('~ip','192.168.125.226')
|
||||||
netport=rospy.get_param('~netport',9000)
|
# netport=rospy.get_param('~netport',9000)
|
||||||
# print("port: {}, baud: {}\n".format(port, baud))
|
print("port: {}, baud: {}\n".format(port, baud))
|
||||||
print('ip:{},port:{}'.format(ip,netport))
|
# print('ip:{},port:{}'.format(ip,netport))
|
||||||
try:
|
try:
|
||||||
# mycobot = MyCobot(port, baud)
|
mycobot = MyCobot(port, baud)
|
||||||
mycobot=MyCobotSocket(ip,netport)
|
# mycobot=MyCobotSocket(ip,netport)
|
||||||
mycobot.connect()
|
# mycobot.connect()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print(e)
|
print(e)
|
||||||
print(
|
print(
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
# encoding:utf-8
|
# encoding:utf-8
|
||||||
# license removed for brevity
|
# license removed for brevity
|
||||||
import time
|
import time
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
import math
|
import math
|
||||||
|
|
||||||
import rospy
|
import rospy
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*-
|
# -*- 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
|
from mycobot_communication.srv import GetCoords, SetCoords, GetAngles, SetAngles, GripperStatus
|
||||||
import rospy
|
import rospy
|
||||||
import time
|
import time
|
||||||
|
|
@ -33,7 +34,7 @@ class Window:
|
||||||
# 计算 Tk 根窗口的 x 和 y 坐标
|
# 计算 Tk 根窗口的 x 和 y 坐标
|
||||||
x = (self.ws / 2) - 190
|
x = (self.ws / 2) - 190
|
||||||
y = (self.hs / 2) - 250
|
y = (self.hs / 2) - 250
|
||||||
self.win.geometry("430x370+{}+{}".format(x, y))
|
self.win.geometry("430x400+{}+{}".format(int(x), int(y)))
|
||||||
# layout,布局
|
# layout,布局
|
||||||
self.set_layout()
|
self.set_layout()
|
||||||
# input section,输入部分
|
# input section,输入部分
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
# encoding:utf-8
|
# encoding:utf-8
|
||||||
"""[summary]
|
"""[summary]
|
||||||
This file obtains the joint angle of the manipulator in ROS,
|
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
|
from pymycobot.mycobotsocket import MyCobotSocket
|
||||||
|
|
||||||
|
|
||||||
ms = None
|
mc = None
|
||||||
|
|
||||||
|
|
||||||
def callback(data):
|
def callback(data):
|
||||||
|
|
@ -26,24 +26,24 @@ def callback(data):
|
||||||
for index, value in enumerate(data.position):
|
for index, value in enumerate(data.position):
|
||||||
data_list.append(value)
|
data_list.append(value)
|
||||||
|
|
||||||
ms.send_radians(data_list, 80)
|
mc.send_radians(data_list, 80)
|
||||||
# time.sleep(0.5)
|
# time.sleep(0.5)
|
||||||
|
|
||||||
|
|
||||||
def listener():
|
def listener():
|
||||||
global ms
|
global mc
|
||||||
rospy.init_node("control_slider", anonymous=True)
|
rospy.init_node("control_slider", anonymous=True)
|
||||||
|
|
||||||
rospy.Subscriber("joint_states", JointState, callback)
|
rospy.Subscriber("joint_states", JointState, callback)
|
||||||
# port = rospy.get_param("~port", "/dev/ttyTHS1")
|
port = rospy.get_param("~port", "/dev/ttyTHS1")
|
||||||
# baud = rospy.get_param("~baud", 1000000)
|
baud = rospy.get_param("~baud", 1000000)
|
||||||
# print(port, baud)
|
print(port, baud)
|
||||||
# mc = MyCobot(port, baud)
|
mc = MyCobot(port, baud)
|
||||||
ip=rospy.get_param("~ip",'192.168.125.226')
|
# ip=rospy.get_param("~ip",'192.168.125.226')
|
||||||
port=rospy.get_param("~port",9000)
|
# port=rospy.get_param("~port",9000)
|
||||||
print(ip,port)
|
# print(ip,port)
|
||||||
ms=MyCobotSocket(ip,port)
|
# ms=MyCobotSocket(ip,port)
|
||||||
ms.connect()
|
# ms.connect()
|
||||||
|
|
||||||
# spin() simply keeps python from exiting until this node is stopped
|
# spin() simply keeps python from exiting until this node is stopped
|
||||||
# spin()只是阻止python退出,直到该节点停止
|
# spin()只是阻止python退出,直到该节点停止
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python3
|
||||||
# encoding=utf-8
|
# encoding=utf-8
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
from mycobot_communication.srv import GetCoords, SetCoords, GetAngles, SetAngles, GripperStatus
|
from mycobot_communication.srv import GetCoords, SetCoords, GetAngles, SetAngles, GripperStatus
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
<launch>
|
<launch>
|
||||||
<!-- Select connecting device and serial port ,选择连接设备及串口-->
|
<!-- Select connecting device and serial port ,选择连接设备及串口-->
|
||||||
<arg name="port" default="/dev/ttyUSB0" />
|
<arg name="port" default="/dev/ttyTHS1" />
|
||||||
<arg name="baud" default="115200" />
|
<arg name="baud" default="1000000" />
|
||||||
|
|
||||||
<!-- Open communication service ,开启通讯服务-->
|
<!-- Open communication service ,开启通讯服务-->
|
||||||
<node name="mycobot_services" pkg="mycobot_communication" type="mycobot_topics_jsnn.py" output="screen">
|
<node name="mycobot_services" pkg="mycobot_communication" type="mycobot_services.py" output="screen">
|
||||||
<param name="port" type="string" value="$(arg port)" />
|
<param name="port" type="string" value="$(arg port)" />
|
||||||
<param name="baud" type="int" value="$(arg baud)" />
|
<param name="baud" type="int" value="$(arg baud)" />
|
||||||
</node>
|
</node>
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
# -*- coding: utf-8 -*
|
# -*- coding: utf-8 -*
|
||||||
import time
|
import time
|
||||||
import rospy
|
import rospy
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue