mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-02 01:41:35 +08:00
Fixed beeping
This commit is contained in:
committed by
Lorenz Meier
parent
61ffc6c432
commit
36efc8c83e
@@ -504,7 +504,7 @@ pthread_addr_t UavcanServers::run(pthread_addr_t)
|
|||||||
_esc_enumeration_active = command_id;
|
_esc_enumeration_active = command_id;
|
||||||
_esc_enumeration_index = 0;
|
_esc_enumeration_index = 0;
|
||||||
_esc_count = 0;
|
_esc_count = 0;
|
||||||
beep(_esc_enumeration_active ? 500.0F : 1000.0F, 0.5F);
|
beep(_esc_enumeration_active ? 500.0F : 1000.0F, 0.2F);
|
||||||
uavcan::protocol::enumeration::Begin::Request req;
|
uavcan::protocol::enumeration::Begin::Request req;
|
||||||
// TODO: Incorrect implementation; the parameter name field should be left empty.
|
// TODO: Incorrect implementation; the parameter name field should be left empty.
|
||||||
// Leaving it as-is to avoid breaking compatibility with non-compliant nodes.
|
// Leaving it as-is to avoid breaking compatibility with non-compliant nodes.
|
||||||
@@ -757,8 +757,8 @@ uint8_t UavcanServers::get_next_dirty_node_id(uint8_t base)
|
|||||||
void UavcanServers::beep(float frequency, float duration)
|
void UavcanServers::beep(float frequency, float duration)
|
||||||
{
|
{
|
||||||
uavcan::equipment::indication::BeepCommand cmd;
|
uavcan::equipment::indication::BeepCommand cmd;
|
||||||
cmd.frequency = 500.0f;
|
cmd.frequency = frequency;
|
||||||
cmd.duration = 0.5f;
|
cmd.duration = duration;
|
||||||
(void)_beep_pub.broadcast(cmd);
|
(void)_beep_pub.broadcast(cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -855,13 +855,13 @@ void UavcanServers::cb_enumeration_save(const uavcan::ServiceCallResult<uavcan::
|
|||||||
{
|
{
|
||||||
if (!result.isSuccessful()) {
|
if (!result.isSuccessful()) {
|
||||||
warnx("UAVCAN ESC enumeration: save request for node %hhu timed out.", result.getCallID().server_node_id.get());
|
warnx("UAVCAN ESC enumeration: save request for node %hhu timed out.", result.getCallID().server_node_id.get());
|
||||||
beep(100.0F, 1.0F);
|
beep(100.0F, 0.5F);
|
||||||
} else if (!result.getResponse().ok) {
|
} else if (!result.getResponse().ok) {
|
||||||
warnx("UAVCAN ESC enumeration: save request for node %hhu rejected", result.getCallID().server_node_id.get());
|
warnx("UAVCAN ESC enumeration: save request for node %hhu rejected", result.getCallID().server_node_id.get());
|
||||||
beep(100.0F, 1.0F);
|
beep(100.0F, 0.5F);
|
||||||
} else {
|
} else {
|
||||||
warnx("UAVCAN ESC enumeration: save request for node %hhu completed OK.", result.getCallID().server_node_id.get());
|
warnx("UAVCAN ESC enumeration: save request for node %hhu completed OK.", result.getCallID().server_node_id.get());
|
||||||
beep(2000.0F, 0.25F);
|
beep(2000.0F, 0.2F);
|
||||||
}
|
}
|
||||||
|
|
||||||
warnx("UAVCAN ESC enumeration: completed %hhu of %hhu", _esc_enumeration_index, _esc_count);
|
warnx("UAVCAN ESC enumeration: completed %hhu of %hhu", _esc_enumeration_index, _esc_count);
|
||||||
|
|||||||
Reference in New Issue
Block a user