mirror of
https://github.com/elephantrobotics/mycobot_ros.git
synced 2026-07-05 19:47:04 +00:00
commit
50a1ee5e13
22 changed files with 125 additions and 114 deletions
|
|
@ -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: <Fixed 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
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
<launch>
|
||||
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
||||
<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="num" default="0" />
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<arg name="baud" default="1000000" />
|
||||
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
||||
<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="num" default="0" />
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<launch>
|
||||
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
||||
<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)" />
|
||||
<!-- mycobot-topics,mycobot-话题 -->
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<launch>
|
||||
<!-- Select connecting device and serial port ,选择连接设备及串口-->
|
||||
<arg name="ip" default="192.168.125.226" />
|
||||
<arg name="port" default="9000" />
|
||||
<arg name="port" default="/dev/ttyTHS1" />
|
||||
<arg name="baud" default="1000000" />
|
||||
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
||||
<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" />
|
||||
|
||||
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
|
||||
|
|
@ -14,9 +14,9 @@
|
|||
<!-- Show in Rviz ,显示在Rviz-->
|
||||
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />
|
||||
|
||||
<include file="$(find mycobot_communication)/launch/communication_service.launch">
|
||||
<arg name="ip" value="$(arg ip)" />
|
||||
<include file="$(find mycobot_communication)/launch/communication_jsnn.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="mycobot_280jn" type="listen_real.py" />
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<arg name="baud" default="1000000" /> -->
|
||||
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
||||
<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" />
|
||||
|
||||
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<launch>
|
||||
<!-- Select connecting device and serial port ,选择连接设备及串口-->
|
||||
<arg name="ip" default="192.168.125.226" />
|
||||
<arg name="port" default="9000" />
|
||||
<arg name="port" default="/dev/ttyTHS1" />
|
||||
<arg name="baud" default="1000000" />
|
||||
<!-- Load URDF, rviz, etc. on the parameter server,加载参数服务器上的URDF、rviz等 -->
|
||||
<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" />
|
||||
|
||||
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
|
||||
|
|
@ -14,9 +14,9 @@
|
|||
<!-- Show in Rviz ,显示在Rviz-->
|
||||
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />
|
||||
|
||||
<include file="$(find mycobot_communication)/launch/communication_service.launch">
|
||||
<arg name="ip" value="$(arg ip)" />
|
||||
<include file="$(find mycobot_communication)/launch/communication_jsnn.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="mycobot_280jn" type="listen_real.py" />
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
<launch>
|
||||
<!-- 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="rvizconfig" default="$(find mycobot_280)/config/mycobot.rviz" />
|
||||
<arg name="model" default="$(find mycobot_description)/urdf/280jn/mycobot_urdf.urdf"/>
|
||||
<arg name="rvizconfig" default="$(find mycobot_280jn)/config/mycobot_jn.rviz" />
|
||||
<arg name="gui" default="true" />
|
||||
|
||||
<param name="robot_description" command="$(find xacro)/xacro --inorder $(arg model)" />
|
||||
|
||||
<!-- Combinejoin values to TF ,将值合并到TF-->
|
||||
<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)" />
|
||||
<!-- <rosparam param="source_list" subst_value="true">["joint_states"]</rosparam> -->
|
||||
</node>
|
||||
|
|
|
|||
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python3
|
||||
# encoding:utf-8
|
||||
# license removed for brevity
|
||||
import time
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python3
|
||||
import math
|
||||
|
||||
import rospy
|
||||
|
|
|
|||
|
|
@ -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,输入部分
|
||||
|
|
|
|||
|
|
@ -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退出,直到该节点停止
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ Panels:
|
|||
- /MotionPlanning1/Scene Robot1
|
||||
- /MotionPlanning1/Planning Request1
|
||||
- /MotionPlanning1/Planned Path1
|
||||
Splitter Ratio: 0.742560029
|
||||
Tree Height: 325
|
||||
Splitter Ratio: 0.7425600290298462
|
||||
Tree Height: 172
|
||||
- Class: rviz/Help
|
||||
Name: Help
|
||||
- Class: rviz/Views
|
||||
|
|
@ -18,6 +18,8 @@ Panels:
|
|||
- /Current View1
|
||||
Name: Views
|
||||
Splitter Ratio: 0.5
|
||||
Preferences:
|
||||
PromptSaveOnExit: true
|
||||
Toolbars:
|
||||
toolButtonStyle: 2
|
||||
Visualization Manager:
|
||||
|
|
@ -29,7 +31,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
|
||||
|
|
@ -45,16 +47,14 @@ Visualization Manager:
|
|||
Class: moveit_rviz_plugin/MotionPlanning
|
||||
Enabled: true
|
||||
Move Group Namespace: ""
|
||||
MoveIt_Allow_Approximate_IK: false
|
||||
MoveIt_Allow_Approximate_IK: true
|
||||
MoveIt_Allow_External_Program: false
|
||||
MoveIt_Allow_Replanning: false
|
||||
MoveIt_Allow_Sensor_Positioning: false
|
||||
MoveIt_Goal_Tolerance: 0
|
||||
MoveIt_Planning_Attempts: 10
|
||||
MoveIt_Planning_Time: 5
|
||||
MoveIt_Use_Cartesian_Path: false
|
||||
MoveIt_Use_Constraint_Aware_IK: true
|
||||
MoveIt_Warehouse_Host: 127.0.0.1
|
||||
MoveIt_Warehouse_Port: 33829
|
||||
MoveIt_Workspace:
|
||||
Center:
|
||||
X: 0
|
||||
|
|
@ -118,20 +118,21 @@ Visualization Manager:
|
|||
State Display Time: 0.05 s
|
||||
Trail Step Size: 1
|
||||
Trajectory Topic: move_group/display_planned_path
|
||||
Use Sim Time: false
|
||||
Planning Metrics:
|
||||
Payload: 1
|
||||
Show Joint Torques: false
|
||||
Show Manipulability: false
|
||||
Show Manipulability Index: false
|
||||
Show Weight Limit: false
|
||||
TextHeight: 0.0799999982
|
||||
TextHeight: 0.07999999821186066
|
||||
Planning Request:
|
||||
Colliding Link Color: 255; 0; 0
|
||||
Goal State Alpha: 1
|
||||
Goal State Color: 250; 128; 0
|
||||
Interactive Marker Size: 0
|
||||
Interactive Marker Size: 0.12999999523162842
|
||||
Joint Violation Color: 255; 0; 255
|
||||
Planning Group: mycobot_arm
|
||||
Planning Group: arm_group
|
||||
Query Goal State: true
|
||||
Query Start State: true
|
||||
Show Workspace: false
|
||||
|
|
@ -142,7 +143,7 @@ Visualization Manager:
|
|||
Scene Geometry:
|
||||
Scene Alpha: 1
|
||||
Scene Color: 50; 230; 50
|
||||
Scene Display Time: 0.200000003
|
||||
Scene Display Time: 0.20000000298023224
|
||||
Show Scene Geometry: true
|
||||
Voxel Coloring: Z-Axis
|
||||
Voxel Rendering: Occupied Voxels
|
||||
|
|
@ -210,30 +211,30 @@ Visualization Manager:
|
|||
Views:
|
||||
Current:
|
||||
Class: rviz/XYOrbit
|
||||
Distance: 1.39158678
|
||||
Distance: 1.3915867805480957
|
||||
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.113567002
|
||||
Y: 0.105920002
|
||||
Z: 2.23518001e-07
|
||||
X: 0.11356700211763382
|
||||
Y: 0.10592000186443329
|
||||
Z: 2.2351800055275817e-07
|
||||
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.439796686
|
||||
Near Clip Distance: 0.009999999776482582
|
||||
Pitch: 0.0647968053817749
|
||||
Target Frame: joint1
|
||||
Value: XYOrbit (rviz)
|
||||
Yaw: 2.5317657
|
||||
Yaw: 3.026766300201416
|
||||
Saved: ~
|
||||
Window Geometry:
|
||||
Displays:
|
||||
collapsed: false
|
||||
Height: 1028
|
||||
Height: 876
|
||||
Help:
|
||||
collapsed: false
|
||||
Hide Left Dock: false
|
||||
|
|
@ -242,9 +243,9 @@ Window Geometry:
|
|||
collapsed: false
|
||||
MotionPlanning - Trajectory Slider:
|
||||
collapsed: false
|
||||
QMainWindow State: 000000ff00000000fd0000000100000000000002ad000003befc0200000007fb000000100044006900730070006c0061007900730100000028000001da000000d700fffffffb0000000800480065006c00700000000342000000bb0000007300fffffffb0000000a0056006900650077007300000003b0000000b0000000ad00fffffffb0000000c00430061006d00650072006100000002ff000001610000000000000000fb0000001e004d006f00740069006f006e00200050006c0061006e006e0069006e00670100000374000001890000000000000000fb00000044004d006f00740069006f006e0050006c0061006e006e0069006e00670020002d0020005400720061006a006500630074006f0072007900200053006c006900640065007201000002080000004a0000004a00fffffffb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e006701000002580000018e0000018300ffffff00000471000003be00000001000000020000000100000002fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
|
||||
QMainWindow State: 000000ff00000000fd0000000100000000000001f300000312fc0200000007fb000000100044006900730070006c006100790073010000003d0000013d000000c900fffffffb0000000800480065006c00700000000342000000bb0000006e00fffffffb0000000a0056006900650077007300000003b0000000b0000000a400fffffffb0000000c00430061006d00650072006100000002ff000001610000000000000000fb0000001e004d006f00740069006f006e00200050006c0061006e006e0069006e00670100000374000001890000000000000000fb00000044004d006f00740069006f006e0050006c0061006e006e0069006e00670020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720100000180000000410000004100fffffffb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e006701000001c7000001880000017d00ffffff0000053f0000031200000001000000020000000100000002fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
|
||||
Views:
|
||||
collapsed: false
|
||||
Width: 1828
|
||||
X: 92
|
||||
Y: 24
|
||||
Width: 1848
|
||||
X: 72
|
||||
Y: 27
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/env python2
|
||||
#!/usr/bin/env python3
|
||||
import time
|
||||
import rospy
|
||||
from sensor_msgs.msg import JointState
|
||||
|
|
|
|||
|
|
@ -131,23 +131,23 @@ class Object_detect(Movement):
|
|||
# pump_control pi
|
||||
def gpio_status(self, flag):
|
||||
if flag:
|
||||
# self.GPIO.output(20, 0)
|
||||
self.GPIO.output(20, 0)
|
||||
self.GPIO.output(21, 0)
|
||||
else:
|
||||
# self.GPIO.output(20, 1)
|
||||
self.GPIO.output(20, 1)
|
||||
self.GPIO.output(21, 1)
|
||||
|
||||
# 开启吸泵 m5
|
||||
def pump_on(self):
|
||||
# 让2号位工作
|
||||
# self.mc.set_basic_output(2, 0)
|
||||
self.mc.set_basic_output(2, 0)
|
||||
# 让5号位工作
|
||||
self.mc.set_basic_output(5, 0)
|
||||
|
||||
# 停止吸泵 m5
|
||||
def pump_off(self):
|
||||
# 让2号位停止工作
|
||||
# self.mc.set_basic_output(2, 1)
|
||||
self.mc.set_basic_output(2, 1)
|
||||
# 让5号位停止工作
|
||||
self.mc.set_basic_output(5, 1)
|
||||
|
||||
|
|
|
|||
|
|
@ -123,23 +123,23 @@ class Object_detect(Movement):
|
|||
# pump_control pi
|
||||
def gpio_status(self, flag):
|
||||
if flag:
|
||||
# self.GPIO.output(20, 0)
|
||||
self.GPIO.output(20, 0)
|
||||
self.GPIO.output(21, 0)
|
||||
else:
|
||||
# self.GPIO.output(20, 1)
|
||||
self.GPIO.output(20, 1)
|
||||
self.GPIO.output(21, 1)
|
||||
|
||||
# 开启吸泵 m5
|
||||
def pump_on(self):
|
||||
# 让2号位工作
|
||||
# self.mc.set_basic_output(2, 0)
|
||||
self.mc.set_basic_output(2, 0)
|
||||
# 让5号位工作
|
||||
self.mc.set_basic_output(5, 0)
|
||||
|
||||
# 停止吸泵 m5
|
||||
def pump_off(self):
|
||||
# 让2号位停止工作
|
||||
# self.mc.set_basic_output(2, 1)
|
||||
self.mc.set_basic_output(2, 1)
|
||||
# 让5号位停止工作
|
||||
self.mc.set_basic_output(5, 1)
|
||||
|
||||
|
|
|
|||
|
|
@ -127,23 +127,23 @@ class Object_detect(Movement):
|
|||
|
||||
def gpio_status(self, flag):
|
||||
if flag:
|
||||
# self.GPIO.output(20, 0)
|
||||
self.GPIO.output(20, 0)
|
||||
self.GPIO.output(21, 0)
|
||||
else:
|
||||
# self.GPIO.output(20, 1)
|
||||
self.GPIO.output(20, 1)
|
||||
self.GPIO.output(21, 1)
|
||||
|
||||
# 开启吸泵 m5
|
||||
def pump_on(self):
|
||||
# 让2号位工作
|
||||
# self.mc.set_basic_output(2, 0)
|
||||
self.mc.set_basic_output(2, 0)
|
||||
# 让5号位工作
|
||||
self.mc.set_basic_output(5, 0)
|
||||
|
||||
# 停止吸泵 m5
|
||||
def pump_off(self):
|
||||
# 让2号位停止工作
|
||||
# self.mc.set_basic_output(2, 1)
|
||||
self.mc.set_basic_output(2, 1)
|
||||
# 让5号位停止工作
|
||||
self.mc.set_basic_output(5, 1)
|
||||
# Grasping motion
|
||||
|
|
|
|||
|
|
@ -131,23 +131,23 @@ class Object_detect(Movement):
|
|||
|
||||
def gpio_status(self, flag):
|
||||
if flag:
|
||||
# self.GPIO.output(20, 0)
|
||||
self.GPIO.output(20, 0)
|
||||
self.GPIO.output(21, 0)
|
||||
else:
|
||||
self.GPIO.output(20, 1)
|
||||
# self.GPIO.output(21, 1)
|
||||
self.GPIO.output(21, 1)
|
||||
|
||||
# 开启吸泵 m5
|
||||
def pump_on(self):
|
||||
# 让2号位工作
|
||||
# self.mc.set_basic_output(2, 0)
|
||||
self.mc.set_basic_output(2, 0)
|
||||
# 让5号位工作
|
||||
self.mc.set_basic_output(5, 0)
|
||||
|
||||
# 停止吸泵 m5
|
||||
def pump_off(self):
|
||||
# 让2号位停止工作
|
||||
# self.mc.set_basic_output(2, 1)
|
||||
self.mc.set_basic_output(2, 1)
|
||||
# 让5号位停止工作
|
||||
self.mc.set_basic_output(5, 1)
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<launch>
|
||||
<!-- Select connecting device and serial port ,选择连接设备及串口-->
|
||||
<arg name="port" default="/dev/ttyUSB0" />
|
||||
<arg name="baud" default="115200" />
|
||||
<arg name="port" default="/dev/ttyTHS1" />
|
||||
<arg name="baud" default="1000000" />
|
||||
|
||||
<!-- 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="baud" type="int" value="$(arg baud)" />
|
||||
</node>
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
#!/usr/bin/env python2
|
||||
# -*- coding: utf-8 -*-
|
||||
# -*- coding: utf-8 -*
|
||||
import time
|
||||
import rospy
|
||||
import os
|
||||
|
|
@ -32,7 +32,10 @@ def acquire(lock_file):
|
|||
else:
|
||||
lock_file_fd = fd
|
||||
break
|
||||
|
||||
# print('pid waiting for lock:%d'% pid)
|
||||
|
||||
|
||||
time.sleep(1.0)
|
||||
current_time = time.time()
|
||||
if lock_file_fd is None:
|
||||
|
|
@ -46,7 +49,6 @@ def release(lock_file_fd):
|
|||
os.close(lock_file_fd)
|
||||
return None
|
||||
|
||||
|
||||
def create_handle():
|
||||
global mc
|
||||
rospy.init_node("mycobot_services")
|
||||
|
|
@ -149,6 +151,8 @@ def toggle_pump(req):
|
|||
mc.set_basic_output(req.Pin1, 1)
|
||||
mc.set_basic_output(req.Pin2, 1)
|
||||
release(lock)
|
||||
|
||||
|
||||
return PumpStatusResponse(True)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue