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

◆ KeyOp()

yocs_keyop::KeyOp::KeyOp ( )

Definition at line 22 of file keyop.cpp.

◆ ~KeyOp()

yocs_keyop::KeyOp::~KeyOp ( )

Definition at line 38 of file keyop.cpp.

Member Function Documentation

◆ decrementAngularVelocity()

void yocs_keyop::KeyOp::decrementAngularVelocity ( )
private

If not already mined, decrement the angular velocities..

Definition at line 408 of file keyop.cpp.

◆ decrementLinearVelocity()

void yocs_keyop::KeyOp::decrementLinearVelocity ( )
private

If not already minned, decrement the linear velocities..

Definition at line 370 of file keyop.cpp.

◆ disable()

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.

◆ enable()

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.

◆ incrementAngularVelocity()

void yocs_keyop::KeyOp::incrementAngularVelocity ( )
private

If not already maxxed, increment the angular velocities..

Definition at line 389 of file keyop.cpp.

◆ incrementLinearVelocity()

void yocs_keyop::KeyOp::incrementLinearVelocity ( )
private

If not already maxxed, increment the command velocities..

Definition at line 351 of file keyop.cpp.

◆ init()

bool yocs_keyop::KeyOp::init ( )

Initialises the node.

Definition at line 46 of file keyop.cpp.

◆ keyboardInputLoop()

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.

◆ processKeyboardInput()

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

Process individual keyboard inputs.

Parameters
ckeyboard input.

Definition at line 231 of file keyop.cpp.

◆ resetVelocity()

void yocs_keyop::KeyOp::resetVelocity ( )
private

Definition at line 424 of file keyop.cpp.

◆ restoreTerminal()

void yocs_keyop::KeyOp::restoreTerminal ( )
private

◆ spin()

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

◆ accept_incoming_

bool yocs_keyop::KeyOp::accept_incoming_
private

Definition at line 40 of file keyop.hpp.

◆ angular_vel_max_

double yocs_keyop::KeyOp::angular_vel_max_
private

Definition at line 46 of file keyop.hpp.

◆ angular_vel_step_

double yocs_keyop::KeyOp::angular_vel_step_
private

Definition at line 46 of file keyop.hpp.

◆ cmd_

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

Definition at line 43 of file keyop.hpp.

◆ cmd_stamped_

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

Definition at line 44 of file keyop.hpp.

◆ disable_motors_publisher_

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

Definition at line 38 of file keyop.hpp.

◆ enable_motors_publisher_

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

Definition at line 38 of file keyop.hpp.

◆ key_file_descriptor_

int yocs_keyop::KeyOp::key_file_descriptor_
private

Definition at line 68 of file keyop.hpp.

◆ last_zero_vel_sent_

bool yocs_keyop::KeyOp::last_zero_vel_sent_
private

Definition at line 39 of file keyop.hpp.

◆ linear_vel_max_

double yocs_keyop::KeyOp::linear_vel_max_
private

Definition at line 45 of file keyop.hpp.

◆ linear_vel_step_

double yocs_keyop::KeyOp::linear_vel_step_
private

Definition at line 45 of file keyop.hpp.

◆ name_

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

Definition at line 47 of file keyop.hpp.

◆ original_terminal_state_

struct termios yocs_keyop::KeyOp::original_terminal_state_
private

Definition at line 69 of file keyop.hpp.

◆ power_status_

bool yocs_keyop::KeyOp::power_status_
private

Definition at line 41 of file keyop.hpp.

◆ quit_requested_

bool yocs_keyop::KeyOp::quit_requested_
private

Definition at line 67 of file keyop.hpp.

◆ thread_

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

Definition at line 70 of file keyop.hpp.

◆ velocity_publisher_

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

Definition at line 38 of file keyop.hpp.

◆ wait_for_connection_

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 Tue Mar 1 2022 00:10:13