@define CELDAS_MAX_VELOCITY 30.\r
@define CELDAS_TURNO 80.\r
@define CELDAS_SENSOR_THRESHOLD 9.\r
+@define CELDAS_VECTOR_ERROR 0.5.\r
\r
PhysicalControl : CeldasControl {\r
% This class is used for building simple vehicle \r
- to get-wheel-radius:\r
return 0.8.\r
\r
+ - to compare-vectors compare-vector vector1(vector) with-vector vector2(vector):\r
+ vectorAux(vector).\r
+ vectorAux=vector1-vector2.\r
+\r
+ if ((|vectorAux::x|<CELDAS_VECTOR_ERROR) && (|vectorAux::y|<CELDAS_VECTOR_ERROR) && (|vectorAux::z|<CELDAS_VECTOR_ERROR))\r
+ return 1.\r
+\r
+ return 0.\r
+ \r
+ to set-global-velocity to velocity (float):\r
rfWheel set-velocity to velocity.\r
lfWheel set-velocity to velocity.\r
+ to get-sensor-value:\r
return (fSensor get-sensor-value).\r
\r
+\r
+\r
+to update-entorno:\r
entorno{"sensor_f"} = (fSensor get-sensor-value).\r
entorno{"sensor_b"} = (bSensor get-sensor-value).\r