namespace RobotNet10.Shared.Sensor;
///
/// Joy message (sensor_msgs/Joy)
/// Reports the state of a joystick's axes and buttons
///
public struct Joy
{
///
/// Header with timestamp and frame ID
///
public Header Header { get; set; }
///
/// The axes measurements from a joystick
///
public double[] Axes { get; set; }
///
/// The buttons measurements from a joystick
///
public int[] Buttons { get; set; }
///
/// Default constructor
///
public Joy()
{
Header = new Header();
Axes = [];
Buttons = [];
}
}
///
/// JoyFeedback message (sensor_msgs/JoyFeedback)
/// Reports the state of a joystick's axes and buttons
///
public struct JoyFeedback
{
///
/// Type constants
///
public const byte TypeLed = 0;
public const byte TypeRumble = 1;
public const byte TypeBuzzer = 2;
///
/// Type of feedback (Type constants)
///
public byte Type { get; set; }
///
/// This will hold an id number for each type of each feedback.
/// Example, the first led would be id=0, the second would be id=1
///
public byte Id { get; set; }
///
/// Intensity of the feedback, from 0.0 to 1.0, inclusive. If device is
/// actually binary, driver should treat 0<=x<0.5 as off, 0.5<=x<=1.0 as on.
///
public double Intensity { get; set; }
///
/// Default constructor
///
public JoyFeedback()
{
Type = TypeLed;
Id = 0;
Intensity = 0.0;
}
}
///
/// JoyFeedbackArray message (sensor_msgs/JoyFeedbackArray)
/// Array of JoyFeedback
///
public struct JoyFeedbackArray
{
///
/// Array of feedback
///
public JoyFeedback[] Array { get; set; }
///
/// Default constructor
///
public JoyFeedbackArray()
{
Array = System.Array.Empty();
}
}