44 #include <ecl/time.hpp> 45 #include <ecl/threads.hpp> 46 #include <ecl/sigslots.hpp> 47 #include <ecl/exceptions.hpp> 48 #include <ecl/linear_algebra.hpp> 49 #include <ecl/geometry/legacy_pose2d.hpp> 83 ecl::LegacyPose2D<double>
getPose();
87 ecl::LegacyPose2D<double>
pose;
139 kobuki.setBaseControl(0,0);
152 std::cout <<
"KobukiManager : using linear vel step [" <<
linear_vel_step <<
"]." << std::endl;
153 std::cout <<
"KobukiManager : using linear vel max [" <<
linear_vel_max <<
"]." << std::endl;
154 std::cout <<
"KobukiManager : using angular vel step [" <<
angular_vel_step <<
"]." << std::endl;
155 std::cout <<
"KobukiManager : using angular vel max [" <<
angular_vel_max <<
"]." << std::endl;
200 ecl::Sleep sleep(0.1);
222 raw.c_lflag &= ~(ICANON | ECHO);
228 puts(
"Reading from keyboard");
229 puts(
"---------------------------");
230 puts(
"Forward/back arrows : linear velocity incr/decr.");
231 puts(
"Right/left arrows : angular velocity incr/decr.");
232 puts(
"Spacebar : reset linear/angular velocities.");
239 perror(
"read char failed():");
359 ecl::LegacyPose2D<double> pose_update;
360 ecl::linear_algebra::Vector3d pose_update_rates;
361 kobuki.updateOdometry(pose_update, pose_update_rates);
389 int main(
int argc,
char** argv)
393 std::cout <<
"Simple Keyop : Utility for driving kobuki by keyboard." << std::endl;
395 kobuki_manager.
init();
398 ecl::LegacyPose2D<double>
pose;
402 pose = kobuki_manager.
getPose();
403 std::cout <<
"current pose: [" << pose.x() <<
", " << pose.y() <<
", " << pose.heading() <<
"]" << std::endl;
405 }
catch ( ecl::StandardException &e ) {
406 std::cout << e.what();
void decrementLinearVelocity()
If not already minned, decrement the linear velocities..
int main(int argc, char **argv)
ecl::LegacyPose2D< double > pose
KobukiManager()
Default constructor, needs initialisation.
void processKeyboardInput(char c)
Process individual keyboard inputs.
std::string device_port
The serial device port name [/dev/kobuki].
void signalHandler(int signum)
std::string sigslots_namespace
The first part of a sigslot connection namespace ["/kobuki"].
void keyboardInputLoop()
The worker thread function that accepts input keyboard commands.
void spin()
Worker thread loop; sends current velocity command at a fixed rate.
void incrementLinearVelocity()
If not already maxxed, increment the command velocities..
Device driver core interface.
void incrementAngularVelocity()
If not already maxxed, increment the angular velocities..
struct termios original_terminal_state
Parameter list and validator for the kobuki.
bool init()
Initialises the node.
Keyboard remote control for our robot core (mobile base).
The core kobuki driver class.
void decrementAngularVelocity()
If not already mined, decrement the angular velocities..
bool enable_acceleration_limiter
Enable or disable the acceleration limiter [true].
ecl::LegacyPose2D< double > getPose()
ecl::Slot slot_stream_data