Trajectory recording and playback
This page contains information on all functions present within trajectory_recording.py and aims to give a clear understanding both of what these functions do and the requirements for any data to be input into them.
These functions allow the user to record and playback specific trajectories for the arm.
Functions
trajectory_recording
Source code in actions\trajectory_recording.py
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 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | |
delete_trajectory(name)
Delete trajectory
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
trajectory name |
required |
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\trajectory_recording.py
162 163 164 165 166 167 168 169 170 171 172 | |
get_record_seconds()
Get record seconds
Note
- Only available if firmware_version >= 2.4.0
- Only valid during recording or after recording but before saving
Returns:
| Name | Type | Description |
|---|---|---|
out |
tuple[int, float]
|
tuple((code, seconds)), returned result is only corrent when code is 0. |
code |
int
|
See the API Code Documentation for details. |
seconds |
float
|
The actual duration of the recorded trajectory |
Source code in actions\trajectory_recording.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | |
get_traj_speeding(rate)
Obtain the joint and velocity values of joint overspeed during trajectory recording
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rate
|
speed rate, only 1/2/4 |
required |
Returns:
| Name | Type | Description |
|---|---|---|
out |
tuple[int, list]
|
tuple((code, speed_info)), returned result is only corrent when code is 0. |
code |
int
|
See the API Code Documentation for details. |
speed_info |
list
|
[result_code, servo_id, servo_speed] result_code: 0: Pass, -1: Fail, >0: abnormal(1:Trajectory not loaded or incorrect status;2:The input magnification is incorrect) servo_id: Effective only when result_code is -1 servo_speed: Effective only when result_code is -1 |
Source code in actions\trajectory_recording.py
174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 | |
get_trajectory_rw_status()
Get trajectory read/write status
Returns:
| Name | Type | Description |
|---|---|---|
out |
tuple[int, int]
|
(code, status) |
code |
int
|
See the API Code Documentation for details. |
status |
int
|
0: no read/write 1: loading 2: load success 3: load failed 4: saving 5: save success 6: save failed |
Source code in actions\trajectory_recording.py
135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | |
load_trajectory(filename, wait=True, timeout=None, **kwargs)
Load a trajectory
Note
- This interface relies on Firmware 1.2.0 or above
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
The name of the trajectory to load |
required | |
wait
|
Whether to wait for loading, default is True |
True
|
|
timeout
|
Timeout waiting for loading to complete |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\trajectory_recording.py
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | |
playback_trajectory(times=1, filename=None, wait=True, double_speed=1, **kwargs)
Playback trajectory
Note
- This interface relies on Firmware 1.2.0 or above
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
times
|
Number of playbacks,
|
1
|
|
filename
|
The name of the trajectory to play back
|
None
|
|
wait
|
whether to wait for the arm to complete, default is False |
True
|
|
double_speed
|
double speed, only support 1/2/4, default is 1, only available if version > 1.2.11 |
1
|
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\trajectory_recording.py
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | |
save_record_trajectory(filename, wait=True, timeout=5, **kwargs)
Save the trajectory you just recorded
Note
- This interface relies on Firmware 1.2.0 or above
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
The name to save
|
required | |
wait
|
Whether to wait for saving, default is True |
True
|
|
timeout
|
Timeout waiting for saving to complete |
5
|
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\trajectory_recording.py
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 | |
start_record_trajectory()
Start trajectory recording, only in teach mode, so joint teaching mode must already be set.
Note
- This interface relies on Firmware 1.2.0 or above
- set joint teaching mode: set_mode(2);set_state(0)
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\trajectory_recording.py
53 54 55 56 57 58 59 60 61 62 63 64 | |
stop_record_trajectory(filename=None, **kwargs)
Stop trajectory recording
Note
- This interface relies on Firmware 1.2.0 or above
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filename
|
The name to save
|
None
|
Returns:
| Name | Type | Description |
|---|---|---|
code |
int
|
See the API Code Documentation for details. |
Source code in actions\trajectory_recording.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 | |