Fang-Robotics-MCB
Fang Robotics Team Codebase
Loading...
Searching...
No Matches
dji_motor_tx_handler.hpp File Reference
#include <limits.h>
#include "tap/util_macros.hpp"
#include "modm/architecture/interface/can_message.hpp"
#include "dji_motor_ids.hpp"
Include dependency graph for dji_motor_tx_handler.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  tap::motor::DjiMotorTxHandler
 

Namespaces

namespace  tap
 
namespace  tap::motor
 

Macros

#define DJI_MOTOR_TO_NORMALIZED_ID(id)
 
#define NORMALIZED_ID_TO_DJI_MOTOR(idx)    static_cast<tap::motor::MotorId>(idx + static_cast<int32_t>(tap::motor::MotorId::MOTOR1))
 

Macro Definition Documentation

◆ DJI_MOTOR_TO_NORMALIZED_ID

#define DJI_MOTOR_TO_NORMALIZED_ID (   id)
Value:
static_cast<uint32_t>( \
static constexpr int DJI_MOTORS_PER_CAN
Definition dji_motor_tx_handler.hpp:77
@ MOTOR1
Definition dji_motor_ids.hpp:39

Converts the dji MotorId to a uint32_t.

Parameters
[in]idSome CAN MotorId
Returns
id normalized to be around [0, DJI_MOTORS_PER_CAN), or some value >= DJI_MOTORS_PER_CAN if the id is out of bounds

◆ NORMALIZED_ID_TO_DJI_MOTOR

#define NORMALIZED_ID_TO_DJI_MOTOR (   idx)     static_cast<tap::motor::MotorId>(idx + static_cast<int32_t>(tap::motor::MotorId::MOTOR1))

Converts the dji MotorId to a uint32_t.

Parameters
[in]idxSome index, a motor id index normalized between [0, DJI_MOTORS_PER_CAN)
Returns
idx, converted to a MotorId