Public Member Functions | Private Member Functions | Private Attributes | List of all members
yocs_keyop::KeyOp Class Reference

Keyboard remote control for your robot. More...

#include <keyop.hpp>

Public Member Functions

bool init ()
 Initialises the node. More...
 
 KeyOp ()
 
void spin ()
 Worker thread loop; sends current velocity command at a fixed rate. More...
 
 ~KeyOp ()
 

Private Member Functions

void decrementAngularVelocity ()
 If not already mined, decrement the angular velocities.. More...
 
void decrementLinearVelocity ()
 If not already minned, decrement the linear velocities.. More...
 
void disable ()
 Disables commands to the navigation system. More...
 
void enable ()
 Reset/re-enable the navigation system. More...
 
void incrementAngularVelocity ()
 If not already maxxed, increment the angular velocities.. More...
 
void incrementLinearVelocity ()
 If not already maxxed, increment the command velocities.. More...
 
void keyboardInputLoop ()
 The worker thread function that accepts input keyboard commands. More...
 
void processKeyboardInput (char c)
 Process individual keyboard inputs. More...
 
void resetVelocity ()
 
void restoreTerminal ()
 

Private Attributes

bool accept_incoming_
 
double angular_vel_max_
 
double angular_vel_step_
 
geometry_msgs::TwistPtr cmd_
 
geometry_msgs::TwistStampedPtr cmd_stamped_
 
ros::Publisher disable_motors_publisher_
 
ros::Publisher enable_motors_publisher_
 
int key_file_descriptor_
 
bool last_zero_vel_sent_
 
double linear_vel_max_
 
double linear_vel_step_
 
std::string name_
 
struct termios original_terminal_state_
 
bool power_status_
 
bool quit_requested_
 
ecl::Thread thread_
 
ros::Publisher velocity_publisher_
 
bool wait_for_connection_
 

Detailed Description

Keyboard remote control for your robot.

Definition at line 22 of file keyop.hpp.

Constructor & Destructor Documentation

yocs_keyop::KeyOp::KeyOp ( )

Definition at line 22 of file keyop.cpp.

yocs_keyop::KeyOp::~KeyOp ( )

Definition at line 38 of file keyop.cpp.

Member Function Documentation

void yocs_keyop::KeyOp::decrementAngularVelocity ( )
private

If not already mined, decrement the angular velocities..

Definition at line 408 of file keyop.cpp.

void yocs_keyop::KeyOp::decrementLinearVelocity ( )
private

If not already minned, decrement the linear velocities..

Definition at line 370 of file keyop.cpp.

void yocs_keyop::KeyOp::disable ( )
private

Disables commands to the navigation system.

This does the following things:

  • Disables power to the navigation motors (via device_manager).
    Parameters
    msg

Definition at line 300 of file keyop.cpp.

void yocs_keyop::KeyOp::enable ( )
private

Reset/re-enable the navigation system.

  • resets the command velocities.
  • reenable power if not enabled.

Definition at line 327 of file keyop.cpp.

void yocs_keyop::KeyOp::incrementAngularVelocity ( )
private

If not already maxxed, increment the angular velocities..

Definition at line 389 of file keyop.cpp.

void yocs_keyop::KeyOp::incrementLinearVelocity ( )
private

If not already maxxed, increment the command velocities..

Definition at line 351 of file keyop.cpp.

bool yocs_keyop::KeyOp::init ( )

Initialises the node.

Definition at line 46 of file keyop.cpp.

void yocs_keyop::KeyOp::keyboardInputLoop ( )
private

The worker thread function that accepts input keyboard commands.

This is ok here - but later it might be a good idea to make a node which posts keyboard events to a topic. Recycle common code if used by many!

Definition at line 195 of file keyop.cpp.

void yocs_keyop::KeyOp::processKeyboardInput ( char  c)
private

Process individual keyboard inputs.

Parameters
ckeyboard input.

Definition at line 231 of file keyop.cpp.

void yocs_keyop::KeyOp::resetVelocity ( )
private

Definition at line 424 of file keyop.cpp.

void yocs_keyop::KeyOp::restoreTerminal ( )
private
void yocs_keyop::KeyOp::spin ( )

Worker thread loop; sends current velocity command at a fixed rate.

It also process ros functions as well as aborting when requested.

Definition at line 150 of file keyop.cpp.

Member Data Documentation

bool yocs_keyop::KeyOp::accept_incoming_
private

Definition at line 40 of file keyop.hpp.

double yocs_keyop::KeyOp::angular_vel_max_
private

Definition at line 46 of file keyop.hpp.

double yocs_keyop::KeyOp::angular_vel_step_
private

Definition at line 46 of file keyop.hpp.

geometry_msgs::TwistPtr yocs_keyop::KeyOp::cmd_
private

Definition at line 43 of file keyop.hpp.

geometry_msgs::TwistStampedPtr yocs_keyop::KeyOp::cmd_stamped_
private

Definition at line 44 of file keyop.hpp.

ros::Publisher yocs_keyop::KeyOp::disable_motors_publisher_
private

Definition at line 38 of file keyop.hpp.

ros::Publisher yocs_keyop::KeyOp::enable_motors_publisher_
private

Definition at line 38 of file keyop.hpp.

int yocs_keyop::KeyOp::key_file_descriptor_
private

Definition at line 68 of file keyop.hpp.

bool yocs_keyop::KeyOp::last_zero_vel_sent_
private

Definition at line 39 of file keyop.hpp.

double yocs_keyop::KeyOp::linear_vel_max_
private

Definition at line 45 of file keyop.hpp.

double yocs_keyop::KeyOp::linear_vel_step_
private

Definition at line 45 of file keyop.hpp.

std::string yocs_keyop::KeyOp::name_
private

Definition at line 47 of file keyop.hpp.

struct termios yocs_keyop::KeyOp::original_terminal_state_
private

Definition at line 69 of file keyop.hpp.

bool yocs_keyop::KeyOp::power_status_
private

Definition at line 41 of file keyop.hpp.

bool yocs_keyop::KeyOp::quit_requested_
private

Definition at line 67 of file keyop.hpp.

ecl::Thread yocs_keyop::KeyOp::thread_
private

Definition at line 70 of file keyop.hpp.

ros::Publisher yocs_keyop::KeyOp::velocity_publisher_
private

Definition at line 38 of file keyop.hpp.

bool yocs_keyop::KeyOp::wait_for_connection_
private

Definition at line 42 of file keyop.hpp.


The documentation for this class was generated from the following files:


yocs_keyop
Author(s): Daniel Stonier, Marcus Liebhardt
autogenerated on Mon Jun 10 2019 15:53:34