Esempio n. 1
0
 /// <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)));
 }
Esempio n. 2
0
 /// <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)));
 }
Esempio n. 3
0
 /// <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 }));
 }
Esempio n. 4
0
 /// <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
 }