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;
64 std::cout << std::endl <<
"Press center 'Clean' button to disconnect and end program" << std::endl;
76 std::cout << std::fixed << std::setprecision(2) <<
"\rOdometry (x, y, yaw): (" 77 << pose.
x <<
", " << pose.
y <<
", " << pose.
yaw <<
") ";
82 std::cout << std::endl;
91 std::cout <<
"Bye!" << std::endl;
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 isCleanButtonPressed() const
Get state of 'clean' button ('play' button on Create 1).
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.
void disconnect()
Disconnect from serial.
int main(int argc, char **argv)
bool setMode(const create::CreateMode &mode)
Change Create mode.