---
# System prepended metadata

title: Error Code
tags: [NTURT, electrical_system, software]

---

# Error Code
###### tags: `software` `electrical_system` `NTURT`

> Error checking mechanism is not implemented on ROS2 system yet.

## Possible errors

1. Any of the launched node dies or error/warn
   1. socketcan_bridge_node
      1. die: can not connect to can hat
      2. error: can not publish frame
      3. warn: receivied frame is error frame
   2. nturt_bag_recorder.py
      1. error: does not record since the disk is almost full
   3. nturt_can_parser_node
      1. die: can configuration `can.yaml` has problem
      2. It may cause other nodes to die since they can't subscribe to this node
   4. nturt_state_controller
      1. die: cannot communicate with can_parser
   5. nturt_torque_controller
      1. die: cannot communicate with can_parser
   6. nturt_gps_node(GPS.py)
      1. error/warn: not receiving gps signal result in NaN? -> still to be tested
      2. Others: still to be tested
   7. nturt_push_to_control_tower
      1. die: cannot communicate with can_parser
      2. die: cannot connect to remote server
      3. Others: still to be tested
2. Not receiving can signal
3. Not receiving gps signal
4. Error from can (have to implement special frame for error message)
5. 

## Viable implementation

1. Checking if a nodes dies: [bond](https://wiki.ros.org/bond)
2. Checking warn/error output of nodes: [/rosout](https://wiki.ros.org/rosout) in message format [rosgraph_msgs/Log Message](https://docs.ros.org/en/melodic/api/rosgraph_msgs/html/msg/Log.html)
3. Transfer string over can signal: [isotp](https://github.com/openxc/isotp-c) to deshboard
