#ifndef __TURTLE3_ROBOT__H_
#define __TURTLE3_ROBOT__H_

#include "robot_base.h"
#include "turtlebot_driver/turtlebot3_motor_driver.h"

class Turtle3Robot: public RobotBase
{
private:
    Turtlebot3MotorDriver motor_driver_;
    bool b_init_;
public:
    Turtle3Robot():b_init_(false)
    {
       if(!motor_driver_.init())
       {
           ROS_INFO(" turtle  driver init failed...\n");
           exit(0);
       }
       b_init_=true;
    }
    ~Turtle3Robot()
    {

    }

protected:
    virtual bool get_odom()
    {
        if(b_init_==false) return false;
        int32_t left=0,right=0;
        bool succ = motor_driver_.readEncoder(left,right);

        if(succ==false) return false;

        ROS_INFO("left:%d, right:%d\n");

        return true;
    }    
    virtual bool post_tf(){return false;}
    virtual bool down_speed()
    {
        if(b_init_==false) return false;
        motor_driver_.speedControl(100, 100);
    }
};



#endif