libnxter  0.1
Example.nxc
1 /* -*- Mode: C; indent-tabs-mode: t; c-basic-offset: 4; tab-width: 4 -*- */
2 /*
3  Example.nxc
4  Copyright (C) 2008 Naba Kumar <naba@gnome.org>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20 
21 #define ENABLE_DEBUG
22 #define ENABLE_TEST
23 
24 #include "Debug.nxc"
25 #include "Angle.nxc"
26 #include "Vector.nxc"
27 #include "Odometer2.nxc"
28 #include "Sonar.nxc"
29 #include "Map.nxc"
30 #include "PID.nxc"
31 #include "Motor.nxc"
32 #include "Vehicle.nxc"
33 #include "RobotPrima.nxc"
34 
35 task main()
36 {
37  SetSensorTouch(PRIMA_TOUCH_SENSOR);
38  SetSensorLight(PRIMA_LIGHT_SENSOR);
39  SetSensorSound(PRIMA_SOUND_SENSOR);
40  SetSensorLowspeed(PRIMA_RANGE_SENSOR);
41  TestVehicle();
42 }
43 
Sonar implementation with an ultrasonic sensor, optionally mounted on a sweep motor.
Implements odometery for 2 wheels drive robot base using motor tachometers.
Debugging utility macros.
A simple 3-components vector implementation (2D point + direction)
Provides simple arithmetic for absolute and relative angles.
A simple 2 wheels drive vehicle implementation that can travel a set of navigation points...
Generic PID controller implementation.
An experimental robotic platform for developing this library.
Motor control implementation.
A 2D map implementation that holds a set of landmark objects.