Control multi-rotor UAVs using the telekyb3 protocol.
Ports
rotor_input (in)
Data structure
|
rotor_measure (out)
Data structure
|
imu (out)
Data structure
|
Provides current gyroscopes and accelerometer measurements.
According to the nature of data, the port is filled with the imu
data timestamp ts
, intrinsic
true, no position (pos
and
pos_cov
are absent) and linear velocities vx
, vy
, vz
set to
NaN
. All other elements are always present.
mag (out)
Data structure
|
Provides current magnetometer measurements.
Services
get_sensor_rate (attribute)
Outputs
|
Get hardware sensor data publishing rate, see set_sensor_rate (attribute).
set_sensor_rate (attribute)
Inputs
|
Set hardware sensor data publishing rate, in Hz
imu
and mag
control the update frequency of port imu (out) and
mag (out) respectively, while motor
and battery
indirectly control
the port rotor_measure (out).
Caution
|
The hardware may not be able to achieve the desired
frequency, especially for motor data when many motors are
controlled. In this case, no error will be reported, but the ports
update rate may be lower than expected and the servo (activity) service
will smoothly stop the motors.
|
get_battery (attribute)
Outputs
|
Get current battery voltage and limits.
set_battery_limits (attribute)
Inputs
|
Throws
|
Set battery minimum and full voltage
This controls the computed energy left
percentage in the port rotor_measure (out).
get_imu_calibration (attribute)
Outputs
|
Get current gyroscopes and accelerometer calibration data.
set_imu_calibration (attribute)
Inputs
|
Set current gyroscopes and accelerometer calibration data.
Calling this service is mandatory after each component start, in order to obtain precise IMU measurements.
Input parameters are typically those returned by a call to get_imu_calibration (attribute) after a successful calibrate_imu (activity) (which see).
get_imu_filter (function)
Outputs
|
set_imu_filter (function)
Inputs
|
set_timeout (attribute)
Inputs
|
Set motor startup timeout
set_ramp (attribute)
Inputs
|
connect (activity)
Inputs
|
Throws
|
Context
|
Connect to the hardware
disconnect (activity)
Throws
|
Context
|
Disconnect from the hardware
monitor (activity)
Throws
|
Context
|
Monitor connection status
disable_motor (function)
Inputs
|
Disable checking a motor status when it is disconnected
enable_motor (function)
Inputs
|
Disable checking a motor status when it is disconnected
calibrate_imu (activity)
Inputs
|
Throws
|
Context
|
Calibrate accelerometers and gyroscopes.
This service computes the 3×3
scaling matrices and 3D
bias vector
for both gyroscopes and accelerometers so that all data is returned
in a consistent, orthogonal frame of reference. This is done by
implementing the paper ‘A robust and easy to implement method for
IMU calibration without external equipments, ICRA 2014’. It requires
no external sensor and a minimum of 10 static poses spanning the
whole SO(3) space, with moderate motion in between. The standard
deviation of the sensor noise is also estimated.
The tstill
parameter controls the time after which a standstill
position is detected (2 seconds is fine), while nposes
sets the
required number of such standstill positions (minimum 10).
While running the calibration, a progress indication will be reported
to the standard output of the component. You should first set the
platform in the first standstill orientation, then start the service.
The service will report stay still
until it has acquired the
first pose, then report acquired pose 1
. You can then move to the
next standstill orientation, leave it until you read the same
messages again, and so on for all the nposes
orientations.
For the calibration to be precise, all the orientations have to be as different as possible one from each other. Also, when moving from one orientation to another, try to perform a motion such that the angular velocities on all 3 axis are not zero.
If you don’t read stay still
after moving to a new
pose, this means that the platform may be vibrating or slightly
moving, and the standstill detection cannot work. After some time,
the service will eventually abort and also report it on the standard
output.
Once all orientations have been acquired, the results are set for the current running instance, and available with get_imu_calibration (attribute). Make sure to save the results somewhere before stopping the component, so that you can load them with set_imu_calibration (attribute) when you later restart.
Caution
|
This procedure does not set any particular vertical axis and the IMU will typically end up calibrated but not aligned with the gravity. Use set_zero (activity) (after calibration) to align the IMU. |
set_zero (activity)
Throws
|
Context
|
Align IMU frame with the gravity vector and reset gyroscopes bias.
This service updates the 3×3
scaling matrices and 3D
bias vector
for both gyroscopes and accelerometers so that the current
accelerometer measurements are only on the Z axis and the gyroscopes
return a 0 angular velocity on each axis.
While running this service, the platform should be perfectly standstill and in a horizontal configuration (i.e. it’s roll and pitch angles are considered zero).
After completion, the current calibration results are updated and can be retrieved with get_imu_calibration (attribute).
This service should be called quite often, as the gyroscopes bias are much dependent on the temperature, so it is important to estimate them well.
start (activity)
Throws
|
Context
|
Spin propellers at the lowest velocity
servo (activity)
Throws
|
Context
|
Control the propellers according to the given velocities
set_velocity (function)
Inputs
|
Throws
|
Context
|
Set the given propeller velocity, once
set_throttle (function)
Inputs
|
Throws
|
Context
|
Set the given propeller voltage
stop (activity)
Context
|
Stop all propellers
log (function)
Inputs
|
Throws
|
Log IMU and commanded wrench
log_stop (function)
Stop logging
log_info (function)
Outputs
|
Show missed log entries
Tasks
main
Context
|