dummy
plantimager.dummy Link
The dummy module offers CNC, Gimbal & Camera implementation
CNC Link
CNC(homing=False, x_lims=[0.0, 100.0], y_lims=[0.0, 100.0], z_lims=[0.0, 30.0])
Bases: AbstractCNC
A dummy CNC for testing purposes.
TODO: enable workspace origin offset, motor seed configuration,...
Attributes:
Name | Type | Description |
---|---|---|
position |
list
|
The current |
x_lims |
((int, int), optional)
|
The allowed range of X-axis positions. |
y_lims |
((int, int), optional)
|
The allowed range of Y-axis positions. |
z_lims |
((int, int), optional)
|
The allowed range of Z-axis positions. |
Examples:
>>> from plantimager.dummy import CNC
>>> cnc = CNC()
>>> cnc.get_position()
[80.5, 80.79, 15.46]
>>> cnc.home()
>>> cnc.get_position()
[0.0, 0.0, 0.0]
>>> cnc.moveto(20, 20, 5)
>>> cnc.get_position()
[20.0, 20.0, 5.0]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
homing
|
bool
|
If |
False
|
x_lims
|
(float, float)
|
The allowed range of X-axis positions. Defaults to |
[0.0, 100.0]
|
y_lims
|
(float, float)
|
The allowed range of Y-axis positions. Defaults to |
[0.0, 100.0]
|
z_lims
|
(float, float)
|
The allowed range of Z-axis positions. Defaults to |
[0.0, 30.0]
|
Notes
If homing
is false, a random initial position will be generated.
Source code in plantimager/dummy.py
70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 |
|
get_position Link
get_position()
Returns the XYZ position of the CNC.
Source code in plantimager/dummy.py
118 119 120 |
|
home Link
home()
Performs axes homing procedure, setting axes position to their origin.
Source code in plantimager/dummy.py
114 115 116 |
|
moveto Link
moveto(x, y, z)
Move axes to target XYZ position.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
float
|
The target XYZ position, in millimeters. |
required |
y
|
float
|
The target XYZ position, in millimeters. |
required |
z
|
float
|
The target XYZ position, in millimeters. |
required |
Source code in plantimager/dummy.py
125 126 127 128 129 130 131 132 133 134 135 136 |
|
moveto_async Link
moveto_async(x, y, z)
Move axes to target XYZ position.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
float
|
The target XYZ position, in millimeters. |
required |
y
|
float
|
The target XYZ position, in millimeters. |
required |
z
|
float
|
The target XYZ position, in millimeters. |
required |
Source code in plantimager/dummy.py
138 139 140 141 142 143 144 145 146 147 148 |
|
start Link
start(homing=False)
Start the CNC.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
homing
|
bool
|
If |
False
|
Source code in plantimager/dummy.py
98 99 100 101 102 103 104 105 106 107 108 109 |
|
Gimbal Link
Gimbal(homing=False, pan_lims=[0.0, 360.0], tilt_lims=[-90.0, 90.0])
Bases: AbstractGimbal
A dummy Gimbal for testing purposes.
Attributes:
Name | Type | Description |
---|---|---|
position |
list
|
The current |
pan_lims |
((float, float), optional)
|
The allowed range of pan-axis positions. Defaults to |
tilt_lims |
((float, float), optional)
|
The allowed range of tilt-axis positions. Defaults to |
Examples:
>>> from plantimager.dummy import Gimbal
>>> gimbal = Gimbal()
>>> gimbal.get_position()
[289.8, 55.43]
>>> gimbal.moveto(90, 10)
>>> gimbal.get_position()
[90.0, 10.0]
>>> gimbal.home()
>>> gimbal.get_position()
[0.0, 0.0]
Parameters:
Name | Type | Description | Default |
---|---|---|---|
homing
|
bool
|
If |
False
|
pan_lims
|
(float, float)
|
The allowed range of pan-axis positions. Defaults to |
[0.0, 360.0]
|
tilt_lims
|
(float, float)
|
The allowed range of tilt-axis positions. Defaults to |
[-90.0, 90.0]
|
Notes
If homing
is false, a random initial position will be generated.
Source code in plantimager/dummy.py
181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
|
get_position Link
get_position()
Returns the pan & tilt position of the Gimbal.
Source code in plantimager/dummy.py
232 233 234 |
|
home Link
home()
Performs axes homing procedure, setting axes position to their origin.
Source code in plantimager/dummy.py
224 225 226 227 |
|
moveto Link
moveto(pan, tilt)
Move the pan & tilt axes to given position.
Source code in plantimager/dummy.py
236 237 238 239 240 |
|
moveto_async Link
moveto_async(pan, tilt)
Move the pan & tilt axes to given position.
Source code in plantimager/dummy.py
245 246 247 248 249 |
|
start Link
start(homing=False)
Start the Gimbal.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
homing
|
bool
|
If |
False
|
Source code in plantimager/dummy.py
206 207 208 209 210 211 212 213 214 215 216 217 218 |
|
stop Link
stop()
Stop the Gimbal.
Source code in plantimager/dummy.py
220 221 222 |
|