ros_alarms - Stateful Alarm System

Stateful alarm system that allows for the immediate kill of a robotic machine.

This package implements a live alarm system, which requires that there is an alarm server consistently alive to field requests. This alarm server maintains the status of all of the robot’s alarms and handles requested get and set operations.

The ros_alarms.Alarm class serves as the data structure used by the alarm server to store data about individual alarms during its lifecycle. This class should not be constructed by clients or other packages. However, this class may be passed into callbacks registered with broadcasters or listeners.

Rather, other clients should interface with this library through the ros_alarms.AlarmListener or ros_alarms.AlarmBroadcaster classes, or the services provided by the alarm server. These classes wrap around the topics published by the running alarm server to provide more useful Pythonic features.

/alarm/get

Handles a string argument, the name of the alarm that is requested. Returns a stamped message containing the alarm information.

/alarm/set

Handles an alarm argument that is used to overwrite the previous alarm information. This argument should contain all information relevant to the alarm.

Because you need to pass an entire alarm object, it is not recommended to use this service in other places. Instead, try using the AlarmBroadcaster class.

/alarm/updates

Topic publishing any getting/setting updates that occur on alarms.

Python

Various Python classes have been built around making the alarm system easier to interface with between nodes.

For example, these classes can be used to immediately control alarms without the need to interface with topics or services:

>>> # Assume that the alarm_server node has been started
>>> from ros_alarms import Alarm, AlarmBroadcaster, AlarmListener
>>> broadcaster = AlarmBroadcaster("test-alarm")
>>> listener = AlarmListener("test-alarm")
>>> def callback(alarm: Alarm):
...     print(f"An alarm with the name {alarm.alarm_name} was called.")
>>> listener.add_callback(callback, call_when_raised = True)
>>> broadcaster.raise_alarm()
An alarm with the name test-alarm was called.

Alarm

class ros_alarms.Alarm(alarm_name: str, raised: bool, node_name: str = 'unknown', problem_description: str = '', parameters: dict = {}, severity: int = 0)[source]

Pythonic representation of a ROS alarm.

This class should not be constructed by clients (excluding internal ros_alarms code, of course). This class is primarily used by the alarm server node to manage data about a series of alarms. However, this class may be passed into callbacks registered to particular alarms.

str(x)

Pretty prints the contents of the alarm. Equivalent to repr(x).

repr(x)

Pretty prints the contents of the alarm. Equivalent to str(x).

alarm_name

The name of this specific alarm.

Type

str

raised

Whether the alarm has been raised.

Type

bool

node_name

The name of the node attached to the alarm. Defaults to unknown.

Type

str

problem_description

A description of the problem related to the alarm. Defaults to an empty string.

Type

str

parameters

The JSON parameters associated with the alarm. Defaults to an empty dict.

Type

dict

severity

The severity associated with a raised alarm. Defaults to 0.

Type

int

stamp

The time of the most recent update. Defaults to now if ROS has been initialized, otherwise zero.

Type

rospy.Time

raised_cbs

A list of callbacks to execute when the alarm is raised. Each callback should be associated with the severity required to execute the callback through a tuple.

Type

List[Tuple[int, Callable]

cleared_cbs

A list of callbacks to execute when the alarm is cleared. Each callback should be associated with the severity required to execute the callback through a tuple.

Type

List[Tuple[int, Callable]

add_callback(funct: Callable, call_when_raised: bool = True, call_when_cleared: bool = True, severity_required: tuple[int, int] = (0, 5))[source]

Adds a callback function to the alarm.

If the callback is set to be called when the alarm has been raised, and the alarm is already raised, then the callback is immediately called. Similarly, if the callback is set to run when the alarm is cleared, and the alarm is already cleared, then the callback is immediately ran. In both cases, the callback is registered like any other callback.

Exceptions in callbacks are swallowed and are printed out through a rospy logging statement.

Parameters
  • funct (Callable) – The callback to add.

  • call_when_raised (bool) – Whether to call the callback when the alarm is raised. Defaults to True.

  • call_when_cleared (bool) – Whether to call the callback when the alarm is cleared. Defaults to True.

  • severity_required (Tuple[int, int]) – The severity required to run the callback. The tuple represents the minimum and maximum severities under which to execute the callback. Defaults to (0, 5).

as_msg() Alarm[source]

Get this alarm as an Alarm message.

Returns

The constructed message.

Return type

AlarmMsg

as_srv_resp() AlarmGetResponse[source]

Get this alarm as an AlarmGet response.

Returns

The constructed service response.

Return type

AlarmGetResponse

classmethod blank(name: str) Alarm[source]

Generate a general blank alarm that is cleared with a low severity.

Parameters

name (str) – The name for the blank alarm.

Returns

The constructed alarm.

Return type

ros_alarms.Alarm

classmethod from_msg(msg: Alarm) Alarm[source]

Generate an alarm object from an Alarm message.

Parameters

msg (AlarmMsg) – The message to generate the object from.

Returns

The constructed alarm.

Return type

Alarm

update(srv: Alarm)[source]

Updates this alarm with a new AlarmSet request. Also will call any required callbacks.

Parameters

srv (ros_alarms.Alarm) – The request to set the alarm.

AlarmServer

class ros_alarms.nodes.alarm_server.AlarmServer[source]

Server responsible for maintaining the status of alarms between all processes.

alarms

A map from the alarm names to to the Alarm objects.

Type

Dict[str, ros_alarms.Alarm]

handlers

A map from the alarm names to their appropriate handlers.

Type

Dict[str, HandlerBase]

meta_alarms

A map from the meta alarm names to the Alarm objects.

Type

Dict[str, ros_alarms.Alarm]

make_tagged_alarm(name: str) Alarm[source]

Makes a blank alarm with the node_name of the alarm_server so that users know it is the initial state.

set_alarm(alarm: Union[Alarm, Alarm]) bool[source]

Sets or updates the alarm.

Updating the alarm triggers all of the alarms callbacks, if any are set. The alarm becomes registered within the server and a message representing the alarm is published to the alarm publishing topic.

Parameters

alarm (Union[ros_alarms.Alarm, ros_alarms.msg.Alarm]) – The alarm to set in the server.

Returns

Whether the operation succeeded.

Return type

bool

AlarmBroadcaster

class ros_alarms.AlarmBroadcaster(name: str, node_name: str | None = None, nowarn: bool = False)[source]

Broadcasts information about an alarm, and allows for the raising and clearing of the alarm.

Parameters
  • name (str) – The name of the related alarm.

  • node_name (Optional[str]) – The name of the node alarm.

  • nowarn (bool) – Whether to disable warning for the class’ operations.

clear_alarm(**kwargs)[source]

Clears the alarm.

Parameters

kwargs – The associated keyword arguments, as described below.

Keyword Arguments
  • node_name (str) – String that holds the name of the node making the request.

  • problem_description (str) – String with a description of the problem (defaults to empty string).

  • parameters (dict) – JSON dumpable dictionary with optional parameters that describe the alarm.

  • severity (int) – Integer in [0, 5] that indicates the severity of the alarm. (5 is most severe)

Returns

Whether the alarm was successfully cleared.

Return type

bool

raise_alarm(**kwargs)[source]

Raises the alarm.

Parameters

kwargs – The associated keyword arguments, as described below.

Keyword Arguments
  • node_name (str) – String that holds the name of the node making the request.

  • problem_description (str) – String with a description of the problem (defaults to empty string).

  • parameters (dict) – JSON dumpable dictionary with optional parameters that describe the alarm.

  • severity (int) – Integer in [0, 5] that indicates the severity of the alarm. (5 is most severe)

Returns

Whether the alarm was successfully raised.

Return type

bool

wait_for_server(timeout=None)[source]
Wait for node to connect to alarm server. Waits timeout seconds (or forever

if timeout is None) to connect then fetches the current alarm and calls callbacks as needed.

Warning

User should always call this method before calling other methods.

Parameters

timeout (Optional[float]) – The amount of seconds to wait before timing out.

AlarmListener

class ros_alarms.AlarmListener(name: str, callback_funct: Callable | None = None, nowarn: bool = False, **kwargs)[source]

Listens to an alarm.

Parameters
  • name (str) – The alarm name.

  • callback_funct (Optional[Callable]) – The callback function.

  • nowarn (bool) – Whether to enable warnings about the class. Defaults to False.

add_callback(funct: Callable, call_when_raised: bool = True, call_when_cleared: bool = True, severity_required: tuple[int, int] = (0, 5))[source]

Adds a callback function to the alarm.

Parameters
  • funct (Callable) – The callback to add.

  • call_when_raised (bool) – Whether to call the callback when the alarm is raised. Defaults to True.

  • call_when_cleared (bool) – Whether to call the callback when the alarm is cleared. Defaults to True.

  • severity_required (Tuple[int, int]) – The severity required to run the callback. The tuple represents the minimum and maximum severities under which to execute the callback. Defaults to (0, 5).

clear_callbacks()[source]

Clears all callbacks.

get_alarm(fetch: bool = True) AlarmGetResponse | None[source]

Returns the alarm message.

Also worth noting, the alarm this method returns has it’s parameters field

converted to a dictionary.

Parameters

fetch (bool) – Whether to fetch the alarm from the server. If False, then uses the most recently cached alarm. Defaults to True.

Returns

The response message, with its updated parameters field.

Return type

AlarmGetResponse

is_cleared(fetch: bool = True) bool[source]

Returns whether this alarm is cleared or not.

Parameters

fetch (bool) – Whether to fetch the alarm from the server. If False, then uses the most recently cached alarm. Defaults to True.

Returns

Whether the alarm is cleared.

Return type

bool

is_raised(fetch: bool = True)[source]

Returns whether this alarm is raised or not.

Parameters

fetch (bool) – Whether to fetch the alarm from the server. If False, then uses the most recently cached alarm. Defaults to True.

Returns

Whether the alarm is raised.

Return type

bool

wait_for_server(timeout: float | None = None)[source]
Wait for node to connect to alarm server. Waits timeout seconds (or forever

if timeout is None) to connect then fetches the current alarm and calls callbacks as needed.

Warning

User should always call this method before calling other methods.

Parameters

timeout (Optional[float]) – The amount of seconds to wait before timing out.

HeartbeatMonitor

class ros_alarms.HeartbeatMonitor(alarm_name: str, topic_name: str, msg_class, prd: float = 0.2, predicate: Callable | None = None, nowarn: bool = False, **kwargs)[source]

Used to trigger an alarm if a message on the topic topic_name isn’t published at least every prd seconds.

An alarm won’t be triggered if no messages are initially received.

All of this class’ methods and attributes are internal.

HandlerBase

Attributes
Methods
class ros_alarms.HandlerBase[source]

Listens for an alarm with this alarm_name. When that alarm is raised, self.raised will be called. When that alarm is cleared, self.cleared will be called. See the comments below for self.meta_predicate.

All alarm handlers must inherit from this base class in order to be registered.

cleared(alarm: Alarm)[source]

Unless on_set is overridden, called whenever a node requests this alarm be cleared. If it returns False, this request is denied. Otherwise, the alarm is raised

Parameters

alarm (ros_alarms.msg._Alarm.Alarm) – The new alarm a node had requested to replace the current with.

property current_alarm: Optional[Alarm]

Returns the status of the alarm this handler is registered for.

Returns

The current alarm instance, if it exists, otherwise None.

Return type

Optional[Alarm]

get_alarm(name: str) Optional[Alarm][source]

Gets the current status of an alarm.

Returns

The request alarm object, or None if it has not been set.

Return type

Optional[Alarm]

meta_predicate(meta_alarm: Alarm, alarms) Union[bool, Alarm][source]

Called on an update to one of this alarms’s meta alarms, if there are any. By default, returns True if any meta alarms are raised.

Parameters
  • meta_alarm (ros_alarms.Alarm) – The alarm object of the meta alarm.

  • alarms (Dict[str, ros_alarms.Alarm]) – A dictionary mapping the name of each child alarm to its Alarm object.

Returns

Returns a bool indicating if the alarm should be raised, or a new Alarm object which the calling alarm should update itself to.

Return type

Union[bool, ros_alarms.Alarm]

on_set(new_alarm: Alarm) Optional[bool][source]

Called whenever a service request is made to the alarm server to the alarm this handler is registered for. Can be used to trigger actions before other nodes are notified of the change or to reject the change. By default, defers to the raised and cleared functions below.

Parameters

new_alarm (ros_alarms.msg._Alarm.Alarm) – Alarm message that is requested to have this alarm change to.

Returns

Either None, in which case the change is accepted or False, in which case the alarm remains the same and the service request fails.

Return type

Optional[bool]

raised(alarm: Alarm)[source]

Unless on_set is overridden, called whenever a node requests this alarm be raised. If it returns False, this request is denied. Otherwise, the alarm is raised.

Parameters

alarm (ros_alarms.msg._Alarm.Alarm) – The new alarm a node had requested to replace the current with.

C++

AlarmProxy

struct AlarmProxy

Representation of a ROS alarm. Used by several other classes to facilitate proper interactions between components.

Public Functions

inline AlarmProxy()

The default class constructor. All parameters are empty or zero.

AlarmProxy(std::string alarm_name, bool raised, std::string node_name, std::string problem_description, std::string json_parameters, int severity)

A constructor which has parameters for all class parameters.

AlarmProxy(std::string alarm_name, bool raised, std::string problem_description, std::string json_parameters, int severity)

A constructor with parameters for all class attributes, except the node name, which is derived from the current node name (using ros::this_node).

AlarmProxy(ros_alarms_msgs::Alarm msg)

Constructs the class from a ROS message.

Parameters

msg – The message to construct the class from.

ros_alarms_msgs::Alarm as_msg()

Converts the Alarm Proxy object to an :class:Alarm message.

Returns

The constructed message.

std::string str(bool full = false) const

Prints a readable representation of the class. Normally prints the alarm name, alarm status, and whether the alarm is raised or cleared. If raised, the severity is also printed.

The full representation also prints the node name, a problem description, and any related JSON parameters.

Parameters

full – Whether to print the full description.

bool operator==(const AlarmProxy &other) const

Overloaded equality operator. Returns true if both alarms share the same name, raised status, node name, problem description, and status.

Parameters

other – The other alarm.

Public Members

std::string alarm_name

The alarm name.

bool raised = false

Whether the alarm has been raised by some service.

std::string node_name

The name of the node connected to the alarm.

std::string problem_description

The description of the problem associated with the alarm.

std::string json_parameters

The JSON parameters associated with the alarm.

int severity = 0

AlarmBroadcaster

Functions
class AlarmBroadcaster

Facilitates operations on an alarm, such as raising or clearing an alarm.

Public Functions

AlarmBroadcaster(ros::NodeHandle &nh, AlarmProxy *alarm = nullptr)

Constructs a broadcaster with an internally controlled (default) or externally controlled AlarmProxy.

Parameters
  • nh – The node handle to associate with the broadcaster.

  • alarm – The alarm proxy.

inline void clear()

Clears the alarm, and publishes the change to the server.

inline void raise()

Raises the alarm, and publishes the change to the server.

inline void updateSeverity(int sev)

Updates the severity associated with an alarm, and raises the alarm. This function should not be used to update the alarm severity to zero.

Parameters

sev – The new severity.

bool publish()

Publishes current state of the AlarmProxy to the server. If the publication encountered an error, a ROS warning is sent alongside returning false.

Returns

The success of the publication.

inline AlarmProxy &getAlarm()

Returns the alarm proxy associated with the broadcaster.

Warning: If the class uses an externally modified alarm proxy, then modifying this class could have reprocussions for other services which rely on that alarm proxy.

Returns

The proxy.

AlarmListener

template<typename callable_t = std::function<void(AlarmProxy)>>
class AlarmListener

Listens to a specific ROS alarm using AlarmProxy.

Public Functions

AlarmListener(ros::NodeHandle &nh, std::string alarm_name)

Default constructor.

Parameters
  • nh – The node handle.

  • alarm_name – The name of the alarm connected to the listener.

inline bool ok() const

Return the status of the listener.

Returns

Whether the listener is operating OK.

inline int getNumConnections()

Get the number of publishers connected to the ROS node.

Returns

The number of connections.

bool waitForConnection(ros::Duration timeout = {-1.0})

Waits for a connection to be established, and returns true if a connection was established.

Waits for a connection to connect to the subscriber as a publisher.

Parameters
  • timeout – The amount of time (in seconds) before the function exits and returns false. Default time is -1 seconds, in which the function will never return false.

  • timeout – The amount of time before the function returns false.

Returns

Whether a connection was established.

Returns

Whether a connection has been established.

inline void start()

Starts the async spinner.

inline void stop()

Stops the async spinner.

inline bool isRaised() const

Returns a cached value of whether the alarm has been raised. Avoids querying the server by using the cache.

Returns

Whether the alarm has been raised, according to the cache.

inline bool isCleared() const

Returns a cached value of whether the alarm is cleared. Does not query the alarm server.

Returns

Whether the alarm is cleared, according to the cache.

inline bool queryRaised()

Queries the alarm server to see if an alarm with this name has been raised.

Returns

Whether the found alarm was raised.

inline bool queryCleared()

Queries the alarm server to see if this alarm has been cleared.

Returns

Whether this alarm was cleared, according to the alarm server.

AlarmProxy getAlarm()

Queries the alarm server for an alarm of the given name.

Returns

The found alarm with the given name.

inline AlarmProxy getCachedAlarm()

Returns the most recently cached alarm returned from the alarm server. Avoids a query by using a cache.

Returns

The most recently cached alarm.

void addCb(callable_t cb)

Registers a callback to be invoked on both raise and clear.

Parameters

cb – The callback function.

void addRaiseCb(callable_t cb)

Registers a callback to be invoked for any severity level.

Parameters

cb – The callback function.

void addRaiseCb(callable_t cb, int severity)

Registers a callback to be invoked for a single severity level.

Parameters
  • cb – The callback function.

  • severity – The severity level to execute the callback for.

void addRaiseCb(callable_t cb, int severity_lo, int severity_hi)

Registers a callback to be invoked for a range of severity levels.

Parameters
  • cb – The callback function.

  • severity_lo – The lowest severity level to execute the callback for.

  • severity_hi – The highest severity level to execute the callback for.

void addClearCb(callable_t cb)

Registers a callback to be invoked when an alarm is cleared.

Parameters

cb – The callback function.

inline ros::Time getLastUpdateTime() const

Returns the last time the alarm was updated.

Returns

The most recent update time.

inline ros::Duration getTimeSinceUpdate() const

Returns the amount of time since the alarm was updated.

Returns

The length of time since the alarm was updated.

bool waitForUpdate(ros::Duration timeout = ros::Duration(-1.0)) const

Returns true if a new update occurs before the function times out. If the function times out, returns false.

Returns

Whether the update occurred.

inline void clearCallbacks()

Clears all callback associated with the listener.

ListenerCb

template<typename callable_t = std::function<void(AlarmProxy)>>
struct ListenerCb

A callback associated with the Alarm Listener class. Helps to manage callbacks by regulating their execution based on the current severity level and desired calling behavior.

Public Types

enum class CallScenario

An enumerator representing when to run the callback.

Values:

enumerator raise

Run the callback only if the alarm has been raised.

enumerator clear

Run the callback only if the alarm has been cleared.

enumerator always

Run the callback under any condition.

Public Functions

inline bool severity_check(int severity)

Checks the severity of the alarm to determine whether the callback should be executed. The severity should be between the lowest and highest severity levels.

Returns

Whether to execute the callback based on severity.

inline void operator()(ros_alarms_msgs::Alarm msg)

Overloads the () operator to execute the callback function only if the specified conditions are met.

Public Members

callable_t cb_func

The specific callback function.

int severity_hi = 5

The highest severity under which the callback can be called.

int severity_lo = 0

The lowest severity under which the callback can be called.

CallScenario call_scenario = CallScenario::always

The scenario under which the callback is executed.

Subjugator-specific

BusVoltage

Attributes
Methods
class alarm_handlers.BusVoltage[source]

Alarm used to monitor the voltage of the bus.

alarm_name

The name of the alarm. For all alarms of this type, this is set equal to bus-voltage.

Type

str

cleared(alarm: Alarm) None[source]

Called when the alarm is cleared. Does nothing.

raised(alarm: Alarm) None[source]

If the severity of the raised alarm is 3, then an indication is raised to all logged-in users about a low bus voltage. If the raised alarm severity is 5, then a message is displayed to all logged-in users about the bus being killed due to low voltage.

Parameters

alarm (ros_alarms.Alarm) – The raised alarm.

HeightOverBottom

Attributes
Methods
class alarm_handlers.HeightOverBottom[source]

Alarm (inheriting from ros_alarms.HandlerBase) which monitors the height of the sub in the water. If too low, then an alarm is triggered. When the sub rises above the limit again, the alarm is cleared.

The height to kill at is obtained from Dynamic Reconfigure, or is assumed to be 0.4. The height of the sub is checked at 2Hz.

alarm_name

The name of the alarm. Set to height-over-bottom.

Type

str

cleared(alarm: Alarm) None[source]

Triggers when the alarm is cleared. Sets the state of the alarm monitor to

Parameters

alarm (ros_alarms.Alarm) – The alarm which was cleared.

raised(alarm: Alarm) None[source]

Triggers when the alarm is raised. Sets the state of the alarm monitor to represent that the alarm was killed.

Parameters

alarm (ros_alarms.Alarm) – The alarm which was raised.

HwKill

Attributes
class alarm_handlers.HwKill[source]

Alarm (inheriting from ros_alarms.HandlerBase) to represent that the sub experienced a hardware kill.

alarm_name

The name of the alarm. Equal to hw-kill.

Type

str

Kill

class alarm_handlers.Kill[source]

Generic kill used to represent the state of an alarm. Uses a threading condition to manage access

alarm_name

The name of the alarm. Set to kill.

Type

str

condition

The threading condition used to manage the shared access to the motherboard.

Type

threading.Condition

HARDWARE_KILL_GRACE_PERIOD_SECONDS

The number of seconds to wait for the hardware kill to be removed after asking for it to be removed. If the kill has not been removed within this amount of time, the motherboard kill is reinstated. Set to 6 seconds.

Type

int

bagger_dump()[source]

Bags the related log information to a list of relevant topics.

cleared(alarm: Alarm)[source]

Called when the alarm is cleared. Attempts to use ~.condition to unset the motherboard kill. If the motherboard kill can’t be deactivated, then it is reinstated and a warning is logged.

Parameters

alarm (ros_alarms.Alarm) – The alarm which was cleared.

raised(alarm: Alarm) None[source]

Called when the alarm is raised. Sets the motherboard kill and attempts to dump the related logging info to a bag file, using the condition. At the end of the use of the condition, the condition is notified.

Parameters

alarm (ros_alarms.Alarm) – The alarm which was raised.

set_mobo_kill(*args, **kwargs)[source]

Sets a motherboard kill.

Raises

rospy.ServiceException – Error in sending a motherboard kill.

NetworkLoss

Attributes
Methods
class alarm_handlers.NetworkLoss[source]

Alarm class used to represent network loss.

alarm_name

The name of the alarm. Set to network-loss.

Type

str

hm

The heartbeat monitor to monitor the network.

Type

ros_alarms.HeartbeatMonitor

cleared(alarm) None[source]

Called when the alarm is cleared. Does nothing.

raised(alarm) None[source]

Called when the alarm is raised. Does nothing.

OdomKill

class alarm_handlers.OdomKill(timeout=0.5)[source]

Will kill the sub when it stops hearing odometry messages or when there is a large discontinuity in state estimation. Only meant to run on the sub as a safety measure.

GRACE_PERIOD

The amount of time to wait after the class comes alive. Used in case odometry disappears just when the class is started. Defaults to 5 seconds.

Type

rospy.Duration

TIMEOUT

The amount of time to wait before an error is logged. Defaults to 0.5 seconds.

Type

rospy.Duration

MAX_JUMP

The amount of meters that the sub is allowed to jump before an error is logged. Defaults to 0.5 meters.

Type

float

LAUNCH_TIME

When the class was started. Used to calculate when the grace period ends.

Type

rospy.Time

ab

The alarm broadcaster for the node, with a name of odom-kill.

Type

ros_alarms.AlarmBroadcaster

check(*args)[source]

Checks to see if an alarm needs to be raised. Raises either an alarm describing that state estimation is not available (if the sub was just started) or that a significant amount of state estimation was lost since the sub was started.

check_continuity(new_odom_msg: Odometry)[source]

Checks the continuity of the odom system. Calculates the difference (in meters) between the current odom message and the previous message. If the sub moved more than 0.5 meters, a discontinuity is reported.

Parameters

new_odom_msg (Odometry) – The new odometry message to which the old will be compared to.

clear_kill(alarm: Alarm)[source]

Clears the kill imposed on the class.

Parameters

alarm (ros_alarms.Alarm) – The alarm which is used to determine if a clear needs to occur.

cleared(alarm: Alarm)[source]

Runs when an alarm is raised. Sets the class’ killed state to False.

need_kill()[source]

Determine if a kill is needed. Checks to see if the odom was lost for a continuous amount of time or if there was a discontinuity in odom measurements.

raised(alarm: Alarm)[source]

Runs when an alarm is raised. Sets the class’ killed state to True.

ThrusterOut

Attributes
Methods
class alarm_handlers.ThrusterOut[source]

Alarm class to indicate that some of the thrusters in the thruster layout are offline.

alarm_name

The name of the alarm. Set to thruster-out.

Type

str

cleared(alarm: Alarm)[source]

Called when the alarm is cleared. Attempts to update the thruster layout with update_layout().

raised(alarm: Alarm)[source]

Called when the alarm is raised. Attempts to update the thruster layout with update_layout().

update_layout(*args, **kwargs)[source]

Attempts to update the thruster layout with the name of any offline thrusters.