public ButtonPressed(SensorInformation details, ButtonType buttonType) : this(EfficioRuntimePINVOKE.new_ButtonPressed(SensorInformation.getCPtr(details), (int)buttonType), true) { if (EfficioRuntimePINVOKE.SWIGPendingException.Pending) { throw EfficioRuntimePINVOKE.SWIGPendingException.Retrieve(); } }
public Faulted(SensorInformation details) : this(EfficioRuntimePINVOKE.new_Faulted(SensorInformation.getCPtr(details)), true) { if (EfficioRuntimePINVOKE.SWIGPendingException.Pending) { throw EfficioRuntimePINVOKE.SWIGPendingException.Retrieve(); } }
private void OnInfoUpdate(SensorInformation newInformation) { text.text = "Motor Information:\n" + "\n" + "Motor1: " + newInformation.motor1 + "\n" + "Motor2: " + newInformation.motor2 + "\n" + "Motor3: " + newInformation.motor3 + "\n" + "Motor4: " + newInformation.motor4; }
public virtual SensorInformation GetSensorInformation() { SensorInformation ret = new SensorInformation(EfficioRuntimePINVOKE.Sensor_GetSensorInformation(swigCPtr), true); if (EfficioRuntimePINVOKE.SWIGPendingException.Pending) { throw EfficioRuntimePINVOKE.SWIGPendingException.Retrieve(); } return(ret); }
protected override void onHandlePacket(IClient client) { int robotLength = consume(4).asInt(); string robot = consume(robotLength).asString(); int jsonLength = consume(4).asInt(); string json = consume(jsonLength).asString(); SensorInformation info = JsonUtility.FromJson <SensorInformation>(json); ModuleClient.Instance.NewInfoFor(robot, info); }
public DeviceSensorDetailPage(SensorInformation dataSensor) { switch (dataSensor) { case SensorInformation.Acelerometer: activeReader = new DeviceSensorDetailViewModel <VectorReading>(CrossDeviceSensors.Current.Accelerometer, (data) => { Reading.Text = $" X -> {data.X} - Y -> {data.Y} - Z -> {data.Z}"; }); break; case SensorInformation.Magnetometer: activeReader = new DeviceSensorDetailViewModel <VectorReading>(CrossDeviceSensors.Current.Magnetometer, (data) => { Reading.Text = $" X -> {data.X} - Y -> {data.Y} - Z -> {data.Z}"; }); break; case SensorInformation.Gyroscope: activeReader = new DeviceSensorDetailViewModel <VectorReading>(CrossDeviceSensors.Current.Gyroscope, (data) => { Reading.Text = $" X -> {data.X} - Y -> {data.Y} - Z -> {data.Z}"; }); break; case SensorInformation.Barometer: activeReader = new DeviceSensorDetailViewModel <double>(CrossDeviceSensors.Current.Barometer, (data) => { Reading.Text = $"{data}"; }); break; case SensorInformation.Pedometer: activeReader = new DeviceSensorDetailViewModel <int>(CrossDeviceSensors.Current.Pedometer, (data) => { Reading.Text = $"{data}"; }); break; } InitializeComponent(); BindingContext = activeReader; }
private void OnInfoUpdate(SensorInformation info) { motor1 = info.motor1; motor2 = info.motor2; motor3 = info.motor3; motor4 = info.motor4; //we are only interested in the left and right rotations of the robot (Y axis) info.orientation.x = 0; info.orientation.z = 0; if (!got_first) { //obtain initial rotation of the robot using the gyroscope inital = info.orientation; got_first = true; } //from the initial rotation, any changes in rotation will kept in check var newRotation = new Quaternion(transform.rotation.x, info.orientation.y - inital.y, transform.rotation.z, info.orientation.w); //All changes in rotation is also applied to the virtual robot gameObject.transform.rotation = newRotation; }
internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SensorInformation obj) { return((obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr); }
/// <summary> /// Check if a sensor is registered in this registry or not. /// </summary> /// <param name="target"></param> /// <returns></returns> public bool IsRegistered(SensorInformation target) { return this.sensors.Any(sensor => sensor.Id == target.Id || (sensor.LogicalDeviceId == target.LogicalDeviceId && sensor.PhysicalDeviceId == target.PhysicalDeviceId)); }
/// <summary> /// Unregister a sensor to this registry. /// </summary> /// <param name="sensor"></param> /// <returns></returns> public Task UnregisterSensor(SensorInformation sensor) { this.classifiedSensors[sensor.Kind].Remove(sensor); this.sensors.Remove(sensor); return Task.FromResult(0); }
private void OnInfoUpdate(SensorInformation info) { info.orientation.x = 0; info.orientation.z = 0; gameObject.transform.rotation = info.orientation; }
public void NewInfoFor(string robot, SensorInformation info) { _actions.Enqueue(delegate { sensorCallbacks[robot](info); }); }