MIRA
Signals | Public Member Functions | Static Public Member Functions | Protected Slots | Protected Member Functions | Protected Attributes | List of all members
DriveView Class Referenceabstract

A view plugin for steering a robot using arrow keys or button clicks. More...

#include <gui/views/DriveView.h>

Inheritance diagram for DriveView:
Inheritance graph
[legend]

Signals

void viewClosed (ViewPart *view)
 
void viewDestroyed (ViewPart *view)
 
void viewActivated (ViewPart *view)
 
void minimizedRequested (ViewPart *view)
 
void currentDockLocationChanged (Qt::DockWidgetArea area)
 

Public Member Functions

virtual void init (IWorkbenchPartSite *site)
 
IWorkbenchPartSitegetSite ()
 
virtual void activate ()
 
virtual void deactivate ()
 
virtual Qt::DockWidgetArea getDefaultDockArea () const
 
bool isVisible () const
 
Qt::DockWidgetArea getDockArea () const
 
bool isActivated () const
 
Class const & getClass () const
 

Static Public Member Functions

static PseudoClass const & CLASS ()
 

Protected Slots

virtual void onVisibilityChanged (bool visible)
 
void onMinimizeRequested ()
 
void onDockLocationChanged (Qt::DockWidgetArea area)
 
void onTopLevelChanged (bool topLevel)
 

Protected Member Functions

virtual QWidget * createPartControl ()
 Implementation of mira::ViewPart. More...
 
void driveServiceChanged ()
 
virtual void focusInEvent (QFocusEvent *)
 
virtual void closeEvent (QCloseEvent *)
 
QMenu * getViewMenu ()
 
ViewPartTitleBargetTitleBar ()
 
void paintEvent (QPaintEvent *event)
 
virtual Class const & internalGetClass () const=0
 

Protected Attributes

float velocityIncrement
 The velocity increment, default: 0.1f [m/s]. More...
 
Duration watchdogTimeout
 Watchdog interval for stopping when no commands are signaled. default: 5sec. More...
 
ServiceProperty driveService
 The service name used for sending driving commands. More...
 
ChannelProperty< bool > motorstopChannel
 The channel used for listening to the motorstop status. More...
 
ViewPartTitleBarmTitleBar
 

Detailed Description

A view plugin for steering a robot using arrow keys or button clicks.

Using the keyboard the robot can be steered with:

The keyboard control only works, if the drive view window has the current keyboard input focus!

If the robot has a current rotation velocity of non-zero and Up or Down is pressed, the translation is not changed but the rotation velocity is set to zero. So the robot stops turning and continues to move straight forward or backward.

The drive view uses RPCs of a service object, which can be configured by the member driveService. To be able to drive the robot, this service must provide at least the method IMotorController::setVelocity(const Velocity2&). Furthermore, the service should provide the methods IMotorController::resetMotorStop() and IMotorController::resetOdometry() to be able to reset the "stop" flag and to reset the odometry to zero (see class robot::IDrive for more details).

If no service is explicitly given by driveService, the DriveView tries to find a service called "IDrive".

Member Function Documentation

◆ createPartControl()

virtual QWidget* createPartControl ( )
protectedvirtual

Implementation of mira::ViewPart.

Implements ViewPart.

◆ driveServiceChanged()

void driveServiceChanged ( )
protected

Member Data Documentation

◆ velocityIncrement

float velocityIncrement
protected

The velocity increment, default: 0.1f [m/s].

◆ watchdogTimeout

Duration watchdogTimeout
protected

Watchdog interval for stopping when no commands are signaled. default: 5sec.

◆ driveService

ServiceProperty driveService
protected

The service name used for sending driving commands.

◆ motorstopChannel

ChannelProperty<bool> motorstopChannel
protected

The channel used for listening to the motorstop status.


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