1 #ifndef AERO_COMMAND_H_ 2 #define AERO_COMMAND_H_ 4 #include <boost/asio.hpp> 5 #include <boost/thread.hpp> 7 #include <unordered_map> 21 bool openPort(std::string _port,
unsigned int _baud_rate);
23 void writeAsync(std::vector<uint8_t>& _send_data);
24 void onReceive(
const boost::system::error_code& _error,
size_t _bytes_transferred);
25 void onTimer(
const boost::system::error_code& _error);
26 void readBufferAsync(uint8_t _size, uint16_t _timeout);
27 void readBuffer(std::vector<uint8_t>& _receive_data, uint8_t _size);
50 bool openPort(std::string _port,
unsigned int _baud_rate);
54 void setCurrent(uint8_t _number,uint8_t _max, uint8_t _down);
55 void onServo(uint8_t _number,uint16_t _data);
56 std::vector<int16_t> getPosition(uint8_t _number);
57 std::vector<uint16_t> getCurrent(uint8_t _number);
58 std::vector<uint16_t> getTemperatureVoltage(uint8_t _number);
59 std::string getVersion(uint8_t _number);
60 std::vector<uint16_t> getStatus(uint8_t _number);
61 void throughCAN(uint8_t _send_no,uint8_t _command,
62 uint8_t _data1, uint8_t _data2, uint8_t _data3, uint8_t _data4, uint8_t _data5);
63 std::vector<int16_t> actuateByPosition(uint16_t _time, int16_t *_data);
64 std::vector<int16_t> actuateBySpeed(int16_t *_data);
65 void runScript(uint8_t _number,uint16_t _data);
std::string receive_buffer_
boost::asio::streambuf stream_buffer_
std::vector< uint8_t > send_data_
SerialCommunication serial_com_