-
Notifications
You must be signed in to change notification settings - Fork 0
/
test1.py
84 lines (64 loc) · 3.18 KB
/
test1.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# test
print("Mon nouveau fichier") ;
##
# Arm Driver : send a set of commands to the robot
#
# This code shows how the Arm Controller API is used
#
# @author el hachemi Alikacem
#
##
from armController.ArmController import ArmController
from armController.ScanRobot import ScanRobot
from armController.CartesianPosition import CartesianPosition
from armController.TwistValues import TwistValues
from armController.JointSpeedValues import JointSpeedValues
from armController.GripperLowlevelControl import GripperLowlevelControl
from armController.NotificationHandler import NotificationHandler, ACTION_NOTIF, ARM_STATE_NOTIF , CONFIG_CHANGE_NOTIF
from armController.ActionSequence import ActionSequence
from armController.JointAnglesValues import JointAnglesValues
from armController.ArmAction import Move2HomePositionAction, Move2PredefinedPositionAction, Move2CartesianPositionAction,\
JointTwistAction, Move2PositionAnglesAction, JointSpeedAction
import time ;
# WHAT IS FOR ...
# TO REMOVE
#def sequence_sexamples(armController) :
# #armControlle
# pass
## -----------------------------------------------------------------------
#
## -----------------------------------------------------------------------
def main() :
# First operation : Creation of the ArmController Instance - creation of the connection and a start a session
armController = ArmController()
# Section Notifications ------------------------------------------------- Start
# Notifications
# Initiates the notification Handling
#notif_handler = NotificationHandler(armController.get_base_client())
# Subsribe to All (the thirteen) notification types
# notif_handler.subscribeAll()
# Or : subsribe for a given set of Notification types - See NotificationHandler.py for the defined notification types
#notif_handler.subscribe_list([ACTION_NOTIF, ARM_STATE_NOTIF , CONFIG_CHANGE_NOTIF ])
# ========================================================================= End
# Device scanning --------------------------------------------------------- START
#scanRobot = ScanRobot(armController)
#scanRobot.scan_devices()
# ========================================================================= End
# Move to Home Position --------------------------------------------------- START
home_position = Move2HomePositionAction()
#armController.perform(home_position)
# ========================================================================= End
# Move to cartesian position ----------------------------------------------- START
#cart_position = CartesianPosition(0.5 , 0. , 0.)
#cart_position = CartesianPosition(0.1 , 0. , 0.0)
cart_position = CartesianPosition(0.3 , 0.0 , 0.6 , 90 , 0 , 90 )
cart_pos_action = Move2CartesianPositionAction(cart_position)
armController.perform(cart_pos_action)
# -- Finalisation du code ----------------------------
# Unsubscribe for all notification
#notif_handler.unsubscribe()
# Ends the sessions and deconnection of the client
armController.disconnect()
## --------------------------------------------------------------
if __name__ == "__main__":
exit(main())