PulsarActuatorReal
PulsarActuatorReal is the canonical API 2.0.0 class for controlling physical PULSAR actuators through a PCP transport adapter.
Source code in pcp_api/pulsar_actuator_real.pyi
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 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 | |
connected
property
Return whether the actuator is connected.
implementation_version
property
Return the physical actuator firmware version.
Mode
Bases: Enum
Control modes available for Pulsar actuator implementations.
Source code in pcp_api/pulsar_actuator_real.pyi
PCP_Items
Bases: Enum
Feedback items available for monitoring actuator state.
Source code in pcp_api/pulsar_actuator_real.pyi
PCP_Parameters
Bases: Enum
Parameters that can be read or written through the actuator API.
Source code in pcp_api/pulsar_actuator_real.pyi
Rates
Bases: Enum
Feedback update rates for high/low frequency data streams.
Source code in pcp_api/pulsar_actuator_real.pyi
SpeedPerformance
Bases: Enum
Performance presets for speed control mode.
Source code in pcp_api/pulsar_actuator_real.pyi
TorquePerformance
Bases: Enum
Performance presets for torque control mode.
Source code in pcp_api/pulsar_actuator_real.pyi
__init__(adapter_handler, address, logger=None)
Initialize a real actuator bound to a PCP adapter and address.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
adapter_handler
|
Any
|
Transport adapter used to send and receive PCP messages. |
required |
address
|
int
|
PCP actuator address. |
required |
logger
|
Optional[Logger]
|
Optional logger used for diagnostics. |
None
|
Source code in pcp_api/pulsar_actuator_real.pyi
blink()
change_address(new_address)
Write a new PCP address to the actuator.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_address
|
int
|
New actuator address in the valid actuator range. |
required |
change_impedance_setpoint(setpoint, FF_gain=nan, K_stiff=nan, K_damp=nan, J_imp=nan, ref_ff_torque=nan, ref_impedance_spd=nan, ref_impedance_acel=nan)
Switch to impedance mode and send an impedance setpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
setpoint
|
float
|
Position reference, in radians. |
required |
FF_gain
|
float
|
Optional feed-forward gain. |
nan
|
K_stiff
|
float
|
Optional impedance stiffness. |
nan
|
K_damp
|
float
|
Optional impedance damping. |
nan
|
J_imp
|
float
|
Optional impedance inertia. |
nan
|
ref_ff_torque
|
float
|
Optional feed-forward torque reference, in Nm. |
nan
|
ref_impedance_spd
|
float
|
Optional impedance speed reference, in rad/s. |
nan
|
ref_impedance_acel
|
float
|
Optional impedance acceleration reference. |
nan
|
Source code in pcp_api/pulsar_actuator_real.pyi
change_mode(mode)
Change the actuator control mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mode
|
Mode
|
Control mode to activate. |
required |
change_position_setpoint(setpoint, FF_gain=nan, spd_Ki=nan, spd_Kp=nan, pos_Kp=nan, ref_ff_torque=nan)
Switch to position mode and send a position setpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
setpoint
|
float
|
Position reference, in radians. |
required |
FF_gain
|
float
|
Optional feed-forward gain. |
nan
|
spd_Ki
|
float
|
Optional speed-loop integral gain. |
nan
|
spd_Kp
|
float
|
Optional speed-loop proportional gain. |
nan
|
pos_Kp
|
float
|
Optional position-loop proportional gain. |
nan
|
ref_ff_torque
|
float
|
Optional feed-forward torque reference, in Nm. |
nan
|
Source code in pcp_api/pulsar_actuator_real.pyi
change_setpoint(setpoint)
Change the setpoint for the current control mode.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
setpoint
|
float
|
Setpoint value for the active mode. |
required |
change_speed_setpoint(setpoint, FF_gain=nan, spd_Ki=nan, spd_Kp=nan, ref_ff_torque=nan)
Switch to speed mode and send a speed setpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
setpoint
|
float
|
Speed reference, in rad/s. |
required |
FF_gain
|
float
|
Optional feed-forward gain. |
nan
|
spd_Ki
|
float
|
Optional speed-loop integral gain. |
nan
|
spd_Kp
|
float
|
Optional speed-loop proportional gain. |
nan
|
ref_ff_torque
|
float
|
Optional feed-forward torque reference, in Nm. |
nan
|
Source code in pcp_api/pulsar_actuator_real.pyi
change_torque_setpoint(setpoint, id_Kp=nan, id_Ki=nan, iq_Kp=nan, iq_Ki=nan)
Switch to torque mode and send a torque setpoint.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
setpoint
|
float
|
Torque reference, in Nm. |
required |
id_Kp
|
float
|
Optional d-axis current proportional gain. |
nan
|
id_Ki
|
float
|
Optional d-axis current integral gain. |
nan
|
iq_Kp
|
float
|
Optional q-axis current proportional gain. |
nan
|
iq_Ki
|
float
|
Optional q-axis current integral gain. |
nan
|
Source code in pcp_api/pulsar_actuator_real.pyi
connect(timeout=1.0)
Connect to the actuator by sending a ping request.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
float
|
Maximum time to wait for a pong response, in seconds. |
1.0
|
Returns:
| Type | Description |
|---|---|
bool
|
|
Source code in pcp_api/pulsar_actuator_real.pyi
disconnect()
enter_bootloader()
get_feedback()
Return the latest feedback values.
Returns:
| Type | Description |
|---|---|
Dict[Any, Any]
|
The current feedback dictionary. |
get_items_blocking(items, timeout=1.0)
Request specific feedback items and wait for their response.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
items
|
List[PCP_Items]
|
Feedback items to request. Requests are capped at the protocol batch limit. |
required |
timeout
|
float
|
Maximum time to wait for a response, in seconds. |
1.0
|
Returns:
| Type | Description |
|---|---|
Dict[PCP_Items, float]
|
Mapping from requested feedback items to received values. Returns an |
Dict[PCP_Items, float]
|
empty mapping on timeout. |
Source code in pcp_api/pulsar_actuator_real.pyi
get_mode()
Return the current actuator control mode.
Returns:
| Type | Description |
|---|---|
Mode
|
The cached control mode, or a mode read from the actuator. |
get_parameters(parameters, timeout=1.0)
Read actuator parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parameters
|
List[PCP_Parameters]
|
Parameters to request. Long requests are split across protocol-sized batches. |
required |
timeout
|
float
|
Maximum time to wait for each response, in seconds. |
1.0
|
Returns:
| Type | Description |
|---|---|
Dict[PCP_Parameters, float]
|
Mapping from parameter enum to the most recently received value. |
Source code in pcp_api/pulsar_actuator_real.pyi
get_parameters_all()
Read all known actuator parameters.
Returns:
| Type | Description |
|---|---|
Dict[PCP_Parameters, float]
|
Mapping from parameter enum to current value. |
internal_change_position_setpoint(setpoint, pos_Ki=nan, pos_Kd=nan, pos_b0=nan, pos_wc=nan, pos_wo=nan, spd_b0=nan, spd_wc=nan, spd_wo=nan)
Send an internal position-controller setpoint packet.
Source code in pcp_api/pulsar_actuator_real.pyi
internal_change_speed_setpoint(setpoint, spd_b0=nan, spd_wc=nan, spd_wo=nan)
Send an internal speed-controller setpoint packet.
is_valid_actuator_address(address)
staticmethod
restore_factory_parameters(settle_time=1.0)
Restore user-writable actuator parameters to firmware factory defaults.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
settle_time
|
float
|
Seconds to wait after sending the restore command before returning. The actuator may briefly stop answering pings while it applies the restored configuration. |
1.0
|
This clears the saved configuration values used for parameters such as gains, limits, profile settings, CAN speed, and direction inversion. It does not erase factory electrical-machine calibration data.
Source code in pcp_api/pulsar_actuator_real.pyi
save_config()
send_ping(timeout=1.0)
Send a ping message and wait for a pong response.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
timeout
|
float
|
Maximum time to wait for a pong response, in seconds. |
1.0
|
Returns:
| Type | Description |
|---|---|
bool
|
|
Source code in pcp_api/pulsar_actuator_real.pyi
set_can_high_speed(high_speed)
set_error_callback(callback)
Set the callback invoked when actuator errors are received.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
Callable[[int, dict], None]
|
Callable receiving the actuator address and error data. |
required |
set_feedback_callback(callback)
Set the callback invoked when feedback data is received.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
callback
|
Callable[[int, dict], None]
|
Callable receiving the actuator address and feedback data. |
required |
Source code in pcp_api/pulsar_actuator_real.pyi
set_feedback_items(items)
Configure the high-frequency feedback item stream.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
items
|
List[PCP_Items]
|
Feedback items to include in telemetry packets. |
required |
set_feedback_rate(rate)
Configure the high-frequency feedback rate.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
rate
|
Union[Rates, int]
|
A |
required |
Source code in pcp_api/pulsar_actuator_real.pyi
set_home_position()
set_low_freq_feedback_callback(callback)
set_parameters(parameters)
Write actuator parameters.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
parameters
|
Dict[PCP_Parameters, float]
|
Mapping from parameter enum to the float value to write. |
required |
set_speed_performance(performance)
Set the actuator speed-control performance preset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
performance
|
SpeedPerformance
|
Speed performance preset to apply. |
required |
set_torque_performance(performance)
Set the actuator torque-control performance preset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
performance
|
TorquePerformance
|
Torque performance preset to apply. |
required |
start()
PulsarActuatorScannerReal
PulsarActuatorScannerReal scans a PCP network for responding physical actuators.
Bases: PulsarActuatorReal
Discover real actuators through a connected CAN adapter.
Source code in pcp_api/pulsar_actuator_real.pyi
is_connected
property
Return whether the scanner is connected to a valid CAN adapter.
__init__(adapter_handler, logger=None)
scan(begin=1, end=...)
Scan an address range for responding actuator devices.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
begin
|
int
|
First address to probe. |
1
|
end
|
int
|
Last address to probe. |
...
|
Returns:
| Type | Description |
|---|---|
List[int]
|
Addresses that responded to ping. |