orca-robotics INTRODUCTION Overview Download and Install Documentation REPOSITORY Interfaces Drivers Libraries Utilities Software Map DEVELOPER Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
rawrxdata.h00001 /* 00002 * Orca-Robotics Project: Components for robotics 00003 * http://orca-robotics.sf.net/ 00004 * Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp 00005 * 00006 * This copy of Orca is licensed to you under the terms described in 00007 * the LICENSE file included in this distribution. 00008 * 00009 */ 00010 00011 #ifndef SEGWAYRMP_RAWRXDATA_H 00012 #define SEGWAYRMP_RAWRXDATA_H 00013 00014 #include <string> 00015 #include "canpacket.h" 00016 00017 namespace segwayrmpacfr { 00018 00019 // 00020 // @brief Holds data received by the host from the RMP, in the RMP's 00021 // raw format (ie everything as counts). 00022 // 00023 // This thing is supposed to have a lifetime longer than an individual CAN packet. 00024 // Since different CAN packets hold different kinds of data, this thing acts 00025 // as an accumulator. 00026 // 00027 // The RawRxData structure is complete when it has a status message 00028 // and all 8 monitoring messages 00029 // 00030 class RawRxData 00031 { 00032 00033 public: 00034 00035 // Data is empty on construction. 00036 RawRxData(); 00037 00038 // Adds information from a packet 00039 void addPacket(const CanPacket &pkt); 00040 00041 // Print out frame data to string 00042 std::string toString() const; 00043 00044 // Did all the packets arrive? 00045 bool isComplete() const; 00046 00047 // Build ID 00048 int16_t build_id; 00049 // Pitch Angle 00050 int16_t pitch; 00051 // Pitch Rate 00052 int16_t pitch_dot; 00053 // Roll Angle 00054 int16_t roll; 00055 // Roll Rate 00056 int16_t roll_dot; 00057 // yaw displacement: generated based on integrated wheel rotations, given known geometry. 00058 uint32_t yaw; 00059 // Yaw rate: based on inertial data (plus inertial drift is zeroed 00060 // periodically when the vehicle is known to be stationary based 00061 // on wheel rotations). 00062 int16_t yaw_dot; 00063 // integrated left wheel displacement 00064 uint32_t left_wheel_displacement; 00065 // Left wheel Velocity 00066 int16_t left_wheel_velocity; 00067 // integrated right wheel displacement 00068 uint32_t right_wheel_displacement; 00069 // Right wheel Velocity 00070 int16_t right_wheel_velocity; 00071 // integrated fore/aft displacement 00072 uint32_t foreaft_displacement; 00073 // Left Motor Torque 00074 int16_t left_torque; 00075 // Right Motor Torque 00076 int16_t right_torque; 00077 // Servo Frames 00078 uint16_t servo_frames; 00079 // User Interface battery voltage 00080 uint16_t ui_battery_voltage; 00081 // User Interface battery status 00082 //uint16_t ui_battery_status; 00083 // Powerbase attery Voltage (min of A, B) 00084 uint16_t base_battery_voltage; 00085 // Operational Mode (0= disabled, 1=tractor, 2= balance) 00086 uint16_t operational_mode; 00087 // Controller Gain Schedule (0=normal, 1=tall, 2=heavy) 00088 uint16_t controller_gain_schedule; 00089 // Velocity command (as received) 00090 int16_t received_velocity_command; 00091 // Turn Command (as received) 00092 int16_t received_turnrate_command; 00093 00094 // CU Status "word 1" 00095 int16_t status_word1; 00096 // CU Status "word 2" 00097 int16_t status_word2; 00098 00099 private: 00100 00101 std::string CuStatus1ToString() const; 00102 std::string CuStatus2ToString() const; 00103 00104 // Track which messages we've received 00105 bool haveMonitorMsg_[8]; 00106 bool haveStatusMsg_; 00107 }; 00108 00109 } 00110 00111 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)