151 kobuki.setBaseControl(0,0);
164 std::cout <<
"Parameters" << std::endl;
165 std::cout <<
"----------" << std::endl;
166 std::cout <<
" - linear_vel_max [" <<
linear_vel_max <<
"]" << std::endl;
167 std::cout <<
" - linear_vel_step [" <<
linear_vel_step <<
"]" << std::endl;
168 std::cout <<
" - angular_vel_max [" <<
angular_vel_max <<
"]" << std::endl;
169 std::cout <<
" - angular_vel_step [" <<
angular_vel_step <<
"]" << std::endl;
170 std::cout << std::endl;
229 std::cout << ecl::yellow <<
"[WARNING] " << message << ecl::reset << std::endl;
233 std::cout << ecl::red <<
"[ERROR] " << message << ecl::reset << std::endl;
251 raw.c_lflag &= ~(ICANON | ECHO);
257 std::cout <<
"Reading from keyboard" << std::endl;
258 std::cout <<
"---------------------" << std::endl;
259 std::cout <<
"Forward/back arrows : linear velocity incr/decr." << std::endl;
260 std::cout <<
"Right/left arrows : angular velocity incr/decr." << std::endl;
261 std::cout <<
"Spacebar : reset linear/angular velocities." << std::endl;
262 std::cout <<
"q : quit." << std::endl;
263 std::cout << std::endl;
269 perror(
"read char failed():");
390 ecl::linear_algebra::Vector3d pose_update_rates;
391 kobuki.updateOdometry(pose_update, pose_update_rates);
419 int main(
int argc,
char** argv)
423 std::cout << ecl::bold <<
"\nSimple Keyop : Utility for driving kobuki by keyboard.\n" << ecl::reset << std::endl;
425 kobuki_manager.
init();
432 pose = kobuki_manager.
getPose();
433 std::cout << ecl::green;
434 std::cout <<
"current pose: [" << pose.x() <<
", " << pose.y() <<
", " << pose.heading() <<
"]" << std::endl;
435 std::cout << ecl::reset;
438 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.
const char * what() const
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).
void relayErrors(const std::string &message)
ecl::Slot< const std::string & > slot_debug_error
The core kobuki driver class.
void connect(const std::string &topic)
void relayWarnings(const std::string &message)
void decrementAngularVelocity()
If not already mined, decrement the angular velocities..
ecl::Slot< const std::string & > slot_debug_warning
bool enable_acceleration_limiter
Enable or disable the acceleration limiter [true].
ecl::LegacyPose2D< double > getPose()
ecl::Slot slot_stream_data