YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
KeyboardJoypad.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2024 Istituto Italiano di Tecnologia (IIT)
3 * All rights reserved.
4 *
5 * This software may be modified and distributed under the terms of the
6 * BSD-2-Clause license. See the accompanying LICENSE file for details.
7 */
8
9#ifndef YARP_DEV_KEYBOARDJOYPAD_H
10#define YARP_DEV_KEYBOARDJOYPAD_H
11
12#include <memory>
13
18
19namespace yarp {
20 namespace dev {
21 class KeyboardJoypad;
22 }
23}
24
29{
30public:
32
33 virtual ~KeyboardJoypad();
34
35 // yarp::dev::DeviceDriver methods
36 virtual bool open(yarp::os::Searchable& cfg) override;
37 virtual bool close() override;
38
39 // yarp::os::RateThread methods
40 virtual bool threadInit() override;
41 virtual void threadRelease() override;
42 virtual void run() override;
43
44 // yarp::dev::IService methods
45 virtual bool startService() override;
46 virtual bool updateService() override;
47 virtual bool stopService() override;
48
49 // yarp::dev::IJoypadController methods
50 virtual bool getAxisCount(unsigned int& axis_count) override;
51 virtual bool getButtonCount(unsigned int& button_count) override;
52 virtual bool getTrackballCount(unsigned int& trackball_count) override;
53 virtual bool getHatCount(unsigned int& hat_count) override;
54 virtual bool getTouchSurfaceCount(unsigned int& touch_count) override;
55 virtual bool getStickCount(unsigned int& stick_count) override;
56 virtual bool getStickDoF(unsigned int stick_id, unsigned int& dof) override;
57 virtual bool getButton(unsigned int button_id, float& value) override;
58 virtual bool getTrackball(unsigned int trackball_id, yarp::sig::Vector& value) override;
59 virtual bool getHat(unsigned int hat_id, unsigned char& value) override;
60 virtual bool getAxis(unsigned int axis_id, double& value) override;
61 virtual bool getStick(unsigned int stick_id, yarp::sig::Vector& value, JoypadCtrl_coordinateMode coordinate_mode) override;
62 virtual bool getTouch(unsigned int touch_id, yarp::sig::Vector& value) override;
63
64private:
65
66 class Impl;
67 std::unique_ptr<Impl> m_pimpl;
68};
69
70
71#endif // YARP_DEV_KEYBOARDJOYPAD_H
Interface implemented by all device drivers.
Common interface for devices that act like services (by which we mean they do something for remote us...
virtual bool close() override
Close the DeviceDriver.
virtual bool getStickCount(unsigned int &stick_count) override
virtual bool startService() override
Initiate the service, whatever it is.
virtual bool getAxis(unsigned int axis_id, double &value) override
virtual bool getTrackballCount(unsigned int &trackball_count) override
virtual bool getButton(unsigned int button_id, float &value) override
virtual bool open(yarp::os::Searchable &cfg) override
Open the DeviceDriver.
virtual bool getTouchSurfaceCount(unsigned int &touch_count) override
virtual bool getStick(unsigned int stick_id, yarp::sig::Vector &value, JoypadCtrl_coordinateMode coordinate_mode) override
virtual void run() override
Loop function.
virtual bool getStickDoF(unsigned int stick_id, unsigned int &dof) override
virtual bool getHat(unsigned int hat_id, unsigned char &value) override
virtual void threadRelease() override
Release method.
virtual bool getAxisCount(unsigned int &axis_count) override
virtual bool stopService() override
Shut down the service, whatever it is.
virtual bool threadInit() override
Initialization method.
virtual bool getTrackball(unsigned int trackball_id, yarp::sig::Vector &value) override
virtual bool getTouch(unsigned int touch_id, yarp::sig::Vector &value) override
virtual bool updateService() override
Give the service the chance to run for a while.
virtual bool getHatCount(unsigned int &hat_count) override
An abstraction for a periodic thread.
A base class for nested structures that can be searched.
Definition Searchable.h:31
The main, catch-all namespace for YARP.
Definition dirs.h:16