Go to the documentation of this file.
135 linear_vel_step(0.05),
137 angular_vel_step(0.33),
138 angular_vel_max(6.6),
139 quit_requested(false),
140 key_file_descriptor(0),
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();
std::string sigslots_namespace
The first part of a sigslot connection namespace ["/kobuki"].
void relayWarnings(const std::string &message)
void decrementAngularVelocity()
If not already mined, decrement the angular velocities..
bool enable_acceleration_limiter
Enable or disable the acceleration limiter [true].
void decrementLinearVelocity()
If not already minned, decrement the linear velocities..
ecl::Slot< const std::string & > slot_debug_warning
ecl::LegacyPose2D< double > getPose()
void processKeyboardInput(char c)
Process individual keyboard inputs.
ecl::LegacyPose2D< double > pose
void spin()
Worker thread loop; sends current velocity command at a fixed rate.
void keyboardInputLoop()
The worker thread function that accepts input keyboard commands.
ecl::Slot< const std::string & > slot_debug_error
void signalHandler(int signum)
Keyboard remote control for our robot core (mobile base).
void incrementAngularVelocity()
If not already maxxed, increment the angular velocities..
struct termios original_terminal_state
void connect(const std::string &topic)
Parameter list and validator for the kobuki.
Device driver core interface.
The core kobuki driver class.
const char * what() const
KobukiManager()
Default constructor, needs initialisation.
void incrementLinearVelocity()
If not already maxxed, increment the command velocities..
ecl::Slot slot_stream_data
bool init()
Initialises the node.
void relayErrors(const std::string &message)
int main(int argc, char **argv)
std::string device_port
The serial device port name [/dev/kobuki].
kobuki_driver
Author(s): Daniel Stonier
, Younghun Ju , Jorge Santos Simon
autogenerated on Wed Mar 2 2022 00:26:14