Code Overview

class Robot

Public Types

enum Level

Values:

enumerator Normal
enumerator Warning
enumerator Error
enum Command

Values:

enumerator Joystic
enumerator Keyboard
enumerator cmd_vel

Public Functions

Robot(std::string robot_name)
Robot(std::string robot_name, float rate_pub)
Robot(std::string robot_name, float rate_pub, std::string)
Robot()
~Robot()

Public Members

std::string m_name
ros::Timer m_timer

Private Functions

void Control()
inline int GetLogLevel()
void calculateOdom()
void cmdVelCallback(const geometry_msgs::Twist::ConstPtr &cmd)
void wheelVelCallback(const mobie_robots_kinematic::VelocityWheel::ConstPtr &vel)
bool CheckLua(lua_State *L, int r)
void ReadConfig(std::string)
bool readField(lua_State*, const char*)

Private Members

Eigen::Vector3d m_turnRadius
Level m_LogLevel
std::vector<Level> m_wheelLog
Command m_source
int m_wheelNumber
std::array<double, 3> m_velocity = {0}
std::array<double, 3> m_odom_vel = {0}
std::array<double, 3> m_odom_pose = {0}
std::map<int, std::unique_ptr<Wheel>> m_wheels
ros::NodeHandle nh_
tf::TransformBroadcaster odom_broadcaster
ros::Subscriber robot_sub
ros::Subscriber robot_sub_wheels
ros::Publisher robot_pub
ros::Publisher robot_pub_odom
class Wheel

Subclassed by Robot::WheelFixed, Robot::WheelSteer

Public Functions

Wheel(int)
Wheel(char, char, float, float, float, float)
virtual void calculate(Robot *ws) = 0
virtual bool validate(Eigen::Vector3d&, float omega, float v, float vy) = 0
virtual double robotVel(double, std::array<double, 3> &f) = 0
void Print()

Public Static Functions

static void push_msgs(Robot*)

Protected Attributes

char l_m_idWheel
float l_m_radius
float l_m_max_ang_vel
float l_m_max_lin_vel
char l_m_placeInMsg
std::array<float, 2> l_m_distanceFromCentre
std::array<float, 2> l_m_velocity = {0}

Protected Static Attributes

static mobie_robots_kinematic::VelocityWheel wheels_msg
class WheelFixed : public Robot::Wheel

Public Functions

virtual void calculate(Robot *ws) override
virtual bool validate(Eigen::Vector3d&, float omega, float v, float vy) override
WheelFixed(char, char, float, float, float, float)
virtual double robotVel(double, std::array<double, 3> &f) override
class WheelSteer : public Robot::Wheel

Public Functions

WheelSteer(char, char, float, float, float, float, float, float)
virtual void calculate(Robot*) override
inline virtual bool validate(Eigen::Vector3d&, float omega, float v, float vy)
virtual double robotVel(double, std::array<double, 3> &f) override

Private Members

std::array<float, 3> l_m_steerAngle