/// <summary> /// Handle sensor update message from Scribbler /// </summary> public void SensorNotificationHandler(brick.Replace notify) { bool[] values = { notify.Body.IRLeft, notify.Body.IRRight }; OperationsPort.Post(new vector.SetAllElements(new List <double>( from v in values select(!v ? 1.0 : 0.0)))); // NOTE: v is being inverted here }
/// <summary> /// Handle sensor update message from Scribbler /// </summary> public void SensorNotificationHandler(brick.Replace notify) { double[] values = { (notify.Body.Stall ? 1.0 : 0.0) }; OperationsPort.Post(new vector.SetAllElements(new List <double>(values))); }
/// <summary> /// Handle sensor update message from Scribbler /// </summary> public void SensorNotificationHandler(brick.Replace notify) { double[] vals = { notify.Body.LineLeft ? 1.0 : 0.0, notify.Body.LineRight ? 1.0 : 0.0 }; OperationsPort.Post(new vector.SetAllElements(new List <double>(vals))); }
/// <summary> /// Handle sensor update message from Scribbler /// </summary> public void SensorNotificationHandler(brick.Replace notify) { OperationsPort.Post(new vector.SetAllElements(new List <double> { notify.Body.LightLeft, notify.Body.LightCenter, notify.Body.LightRight })); }