36 int main(
int argc,
char** argv) {
39 std::string port =
"/dev/ttyUSB0";
41 if (argc > 1 && std::string(argv[1]) ==
"create1") {
44 std::cout <<
"Running driver for Create 1" << std::endl;
47 std::cout <<
"Running driver for Create 2" << std::endl;
55 std::cout <<
"Connected to robot" << std::endl;
57 std::cout <<
"Failed to connect to robot on port " << port.c_str() << std::endl;
74 std::cout << std::fixed << std::setprecision(2) <<
"\rOdometry (x, y, yaw): (" 75 << pose.
x <<
", " << pose.
y <<
", " << pose.
yaw <<
") ";
static RobotModel CREATE_1
Compatible with Create 1 or Roomba 500 series.
create::Pose getPose() const
Get the estimated pose of Create based on wheel encoders.
bool driveRadius(const float &velocity, const float &radius)
Set the average wheel velocity and turning radius of Create.
bool connect(const std::string &port, const int &baud)
Make a serial connection to Create.
static RobotModel CREATE_2
Compatible with Create 2 or Roomba 600 series and greater.
int main(int argc, char **argv)
bool setMode(const create::CreateMode &mode)
Change Create mode.