Excavation - Razorbotz/RMC-Code-20-21 GitHub Wiki
Excavation Overview:
Functions:
*findOdriveObjects(self): Connects to the two ODrive motor controller boards. Currently the code uses board 206736A1424D as the elevation control board and board 20773881304E to control the auger speed and angle.
*calibrate(self): Calls calibration function for both axes on both boards to allow the encoders to orient and to allow the motors to run without errors.
*setRequestedState(self): Configures the ODrive boards to use position control functions for the elevation and angle motors and velocity control for the auger motor. After configuring the motors, initializes the positions and speed to zero.
*excavationElevationCallback(self, msg): Sets the position of the elevation motors to the position specified by the ROS2 message.
*excavationAugerCallback(self, msg): Sets the velocity of the auger motor to the velocity specified by the ROS2 message.
*excavationAngleCallback(self, msg): Sets the position of the angle motor to the position specified by the ROS2 message.
*init(self): Creates ROS2 node called excavation_node and subscriptions to excavationElevation, excavationAuger, and excavationAngle, then calls findODriveObjects(), calibrate(), and setRequestedState()
Resources:
*ODrive Documentation: https://docs.odriverobotics.com/
*ODrive API Documentation: https://docs.odriverobotics.com/api/odrive