YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
FakeJoypad.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023-2023 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: LGPL-2.1-or-later
4 */
5
6#ifndef FAKEJOYPAD_H
7#define FAKEJOYPAD_H
8
11#include <vector>
13
25{
26 size_t m_buttonCount {4};
27 size_t m_axisCount {4};
28 size_t m_stickCount {4};
29 size_t m_touchCount {4};
30 size_t m_ballCount {4};
31 size_t m_hatCount {4};
32
33 yarp::dev::TrackballData m_data_trackBall;
34 std::vector<yarp::dev::TouchData> m_data_touch;
35 yarp::dev::StickData m_data_stick;
36
37public:
38 FakeJoypad();
39 virtual ~FakeJoypad();
40
41 //DeviceDriver
42 bool open(yarp::os::Searchable& config) override;
43 bool close() override;
44
45 //IJoypadController
46 yarp::dev::ReturnValue getAxisCount(size_t& axis_count) override;
47 yarp::dev::ReturnValue getButtonCount(size_t& button_count) override;
48 yarp::dev::ReturnValue getHatCount(size_t& hat_count) override;
49 yarp::dev::ReturnValue getTrackballCount(size_t& trackball_count) override;
50 yarp::dev::ReturnValue getTouchSurfaceCount(size_t& touch_count) override;
51 yarp::dev::ReturnValue getStickCount(size_t& stick_count) override;
52 yarp::dev::ReturnValue getButton(size_t button_id, double& value) override;
53 yarp::dev::ReturnValue getTrackball(size_t trackball_id, yarp::dev::TrackballData& value) override;
54 yarp::dev::ReturnValue getHat(size_t hat_id, unsigned char& value) override;
55 yarp::dev::ReturnValue getAxis(size_t axis_id, double& value) override;
56 yarp::dev::ReturnValue getStick(size_t stick_id, yarp::dev::StickData& value, JoypadCtrl_coordinateMode coordinate_mode) override;
57 yarp::dev::ReturnValue getTouch(size_t touch_id, std::vector<yarp::dev::TouchData>& value) override;
58};
59
60
61#endif //#define FAKEJOYPAD_H
This class is the parameters parser for class FakeJoypad.
FakeJoypad : fake device implementing the device interface
Definition FakeJoypad.h:25
yarp::dev::ReturnValue getStickCount(size_t &stick_count) override
Get the number of the sticks.
yarp::dev::ReturnValue getHatCount(size_t &hat_count) override
Get number of hats.
bool close() override
Close the DeviceDriver.
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.
yarp::dev::ReturnValue getTrackballCount(size_t &trackball_count) override
Get number of trackballs.
virtual ~FakeJoypad()
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
yarp::dev::ReturnValue getTouchSurfaceCount(size_t &touch_count) override
Get the number of touch surface.
yarp::dev::ReturnValue getButtonCount(size_t &button_count) override
Get number of buttons.
yarp::dev::ReturnValue getButton(size_t button_id, double &value) override
Get the value of a button.
yarp::dev::ReturnValue getHat(size_t hat_id, unsigned char &value) override
Get the value of an Hat.
yarp::dev::ReturnValue getAxis(size_t axis_id, double &value) override
Get the value of an axis if present, return false otherwise.
yarp::dev::ReturnValue getTrackball(size_t trackball_id, yarp::dev::TrackballData &value) override
Get the axes change of a Trackball.
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.
yarp::dev::ReturnValue getAxisCount(size_t &axis_count) override
Get number of axes.
Interface implemented by all device drivers.
A base class for nested structures that can be searched.
Definition Searchable.h:31