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 yarp::dev::ReturnValue getAxisCount(size_t& axis_count) override;
51 virtual yarp::dev::ReturnValue getButtonCount(size_t& button_count) override;
52 virtual yarp::dev::ReturnValue getTrackballCount(size_t& trackball_count) override;
53 virtual yarp::dev::ReturnValue getHatCount(size_t& hat_count) override;
54 virtual yarp::dev::ReturnValue getTouchSurfaceCount(size_t& touch_count) override;
55 virtual yarp::dev::ReturnValue getStickCount(size_t& stick_count) override;
56 virtual yarp::dev::ReturnValue getButton(size_t button_id, double& value) override;
57 virtual yarp::dev::ReturnValue getTrackball(size_t trackball_id, yarp::dev::TrackballData& value) override;
58 virtual yarp::dev::ReturnValue getHat(size_t hat_id, unsigned char& value) override;
59 virtual yarp::dev::ReturnValue getAxis(size_t axis_id, double& value) override;
60 virtual yarp::dev::ReturnValue getStick(size_t stick_id, yarp::dev::StickData& value, JoypadCtrl_coordinateMode coordinate_mode) override;
61 virtual yarp::dev::ReturnValue getTouch(size_t touch_id, std::vector<yarp::dev::TouchData>& value) override;
62
63private:
64
65 class Impl;
66 std::unique_ptr<Impl> m_pimpl;
67};
68
69
70#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 yarp::dev::ReturnValue getStick(size_t stick_id, yarp::dev::StickData &value, JoypadCtrl_coordinateMode coordinate_mode) override
Get the value of a stick if present, return false otherwise.
virtual yarp::dev::ReturnValue getHat(size_t hat_id, unsigned char &value) override
Get the value of an Hat.
virtual bool startService() override
Initiate the service, whatever it is.
virtual yarp::dev::ReturnValue getTrackball(size_t trackball_id, yarp::dev::TrackballData &value) override
Get the axes change of a Trackball.
virtual yarp::dev::ReturnValue getButton(size_t button_id, double &value) override
Get the value of a button.
virtual bool open(yarp::os::Searchable &cfg) override
Open the DeviceDriver.
virtual void run() override
Loop function.
virtual yarp::dev::ReturnValue getButtonCount(size_t &button_count) override
Get number of buttons.
virtual yarp::dev::ReturnValue getAxis(size_t axis_id, double &value) override
Get the value of an axis if present, return false otherwise.
virtual yarp::dev::ReturnValue getTouch(size_t touch_id, std::vector< yarp::dev::TouchData > &value) override
Get the value of a touch if present, return false otherwise.
virtual yarp::dev::ReturnValue getAxisCount(size_t &axis_count) override
Get number of axes.
virtual yarp::dev::ReturnValue getHatCount(size_t &hat_count) override
Get number of hats.
virtual void threadRelease() override
Release method.
virtual yarp::dev::ReturnValue getStickCount(size_t &stick_count) override
Get the number of the sticks.
virtual yarp::dev::ReturnValue getTouchSurfaceCount(size_t &touch_count) override
Get the number of touch surface.
virtual bool stopService() override
Shut down the service, whatever it is.
virtual bool threadInit() override
Initialization method.
virtual bool updateService() override
Give the service the chance to run for a while.
virtual yarp::dev::ReturnValue getTrackballCount(size_t &trackball_count) override
Get number of trackballs.
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