PalouseRobosub / robosub

Code for the computer on the sub
GNU General Public License v3.0
13 stars 0 forks source link

Write Thruster ROS Node #5

Closed irwineffect closed 7 years ago

irwineffect commented 7 years ago

A ROS node needs to be created that accepts thruster messages and controls the thrusters.

Inputs

ros topic: thruster msg type: robosub/thruster Note that this message is of an array type, so this module should be able to still work if the number of thrusters change.

Outputs

Serial (UART) interface with the thruster controller, which is a Mini Maestro from Pololu. You can find the serial protocol documentation here: https://www.pololu.com/docs/0J40/5.c

gaofangfrank commented 7 years ago

Hi this is Frank from the electrical team. I'm going to try to write a class

class ThrusterController
{
    public:
        ThrusterController(); // default constructor should be called
        ~ThrusterController(); // hopefully will terminate thrusters upon destruction

        bool configure(); // this would try to open up the serial port to the thruster controller 
                                   // return false if thruster controller not detected. 
        int SendData(float *thrusterSpeedData, int length); // see below

// Someone need to give me some kind of 
// data  parsed from the ROS message for an array of float(? double?) values ranging from -1 to 1, 
// whereas -1 is full reverse, and 1 is full speed forward, also need the length of the 
// array being passed in, or possibly define a struct/class that holds a pair of data, such as 
// struct ThrusterSpeedVector{ float speed, int ThrusterNumber}; 
// and pass in an array of those with the number of them. 
}