14 #include <ecl/time.hpp> 15 #include <ecl/sigslots.hpp> 16 #include <ecl/geometry/legacy_pose2d.hpp> 17 #include <ecl/linear_algebra.hpp> 40 kobuki.setBaseControl(0,0);
45 ecl::LegacyPose2D<double> pose_update;
46 ecl::linear_algebra::Vector3d pose_update_rates;
47 kobuki.updateOdometry(pose_update, pose_update_rates);
49 dx += pose_update.x();
50 dth += pose_update.heading();
59 if (
dx >= 1.0 &&
dth >= ecl::pi/2.0) {
dx=0.0;
dth=0.0;
kobuki.setBaseControl(0.0, 0.0);
return; }
60 else if (
dx >= 1.0) {
kobuki.setBaseControl(0.0, 3.3);
return; }
61 else {
kobuki.setBaseControl(0.3, 0.0);
return; }
70 ecl::LegacyPose2D<double>
pose;
88 int main(
int argc,
char** argv)
92 std::cout <<
"Demo : Example of simple control loop." << std::endl;
96 ecl::LegacyPose2D<double>
pose;
100 pose = kobuki_manager.
getPose();
101 std::cout <<
"current pose: [" << pose.x() <<
", " << pose.y() <<
", " << pose.heading() <<
"]" << std::endl;
103 }
catch ( ecl::StandardException &e ) {
104 std::cout << e.what();
ecl::LegacyPose2D< double > pose
std::string device_port
The serial device port name [/dev/kobuki].
std::string sigslots_namespace
The first part of a sigslot connection namespace ["/kobuki"].
Device driver core interface.
int main(int argc, char **argv)
Parameter list and validator for the kobuki.
Keyboard remote control for our robot core (mobile base).
The core kobuki driver class.
void signalHandler(int signum)
bool enable_acceleration_limiter
Enable or disable the acceleration limiter [true].
ecl::LegacyPose2D< double > getPose()
ecl::Slot slot_stream_data