24 m_data_touch.resize(2);
51 button_count = m_buttonCount;
69 touch_count = m_touchCount;
75 stick_count = m_stickCount;
81 if (button_id > m_buttonCount)
86 value = button_id*11.0;
92 if (axis_id > m_axisCount)
97 value = axis_id * 10.0;
103 if (stick_id > m_stickCount)
110 value.
s1 = m_data_stick.
s1 = stick_id * 100;
111 value.
s2 = m_data_stick.
s2 = stick_id * 101;
115 value.
s1 = m_data_stick.
s1 = stick_id * 102;
116 value.
s2 = m_data_stick.
s2 = stick_id * 103;
123 if (touch_id > m_touchCount)
130 value[0].x = m_data_touch[0].x = (
double)(touch_id) * 110.0;
131 value[0].y = m_data_touch[0].y = (
double)(touch_id) * 111.0;
132 value[1].x = m_data_touch[1].x = (
double)(touch_id) * 112.0;
133 value[1].y = m_data_touch[1].y = (
double)(touch_id) * 113.0;
139 if (hat_id > m_hatCount)
150 if (trackball_id > m_ballCount)
152 yCError(
FAKEJOYPAD) <<
"trackball_id out of bounds when calling 'getTrackball' method";
156 value.
x = m_data_trackBall.
x = (
double)(trackball_id)*120;
157 value.
y = m_data_trackBall.
y = (
double)(trackball_id)*121;
#define ReturnValue_error_input_out_of_bounds
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
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.
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.
JoypadCtrl_coordinateMode
A mini-server for performing network communication in the background.
A base class for nested structures that can be searched.
#define yCError(component,...)
#define YARP_LOG_COMPONENT(name,...)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.