|
Robot Agent
1.0
|
#include "serialport.h"Go to the source code of this file.
Data Structures | |
| struct | s_OPENINTERFACE_SENSOR_STRUCT |
| Open Interface Sensor structure. More... | |
| struct | s_OPENINTERFACE_STRUCT |
| Open Interface structure. More... | |
Typedefs | |
| typedef struct s_OPENINTERFACE_SENSOR_STRUCT | openinterface_sensor_t |
| Open Interface Sensor structure. More... | |
| typedef struct s_OPENINTERFACE_STRUCT | openinterface_t |
| Open Interface structure. More... | |
Functions | |
| openinterface_t * | openinterface_open (char *device_path) |
| int | openinterface_close (openinterface_t *ois) |
| int | openinterface_start (openinterface_t *ois) |
| int | openinterface_full (openinterface_t *ois) |
| int | openinterface_drive (openinterface_t *ois, int velocity, int radius) |
| int | openinterface_drive_direct (openinterface_t *ois, int right, int left) |
| int | openinterface_sensor_get (openinterface_t *ois, const unsigned char id, const unsigned char len, unsigned char *data) |
| int | openinterface_sensors_update (openinterface_t *ois, const unsigned int sensor_id, const unsigned int size) |
| int | openinterface_distance_get (openinterface_t *ois) |
| int | openinterface_angle_get (openinterface_t *ois) |
| int | openinterface_LEDs (openinterface_t *ois, int play, int advance, unsigned char power_color, unsigned char power_intensity) |
| #define s_OI_CMD_DIGITAL_OUTPUTS 0x93 |
Definition at line 118 of file openinterface.h.
| #define s_OI_CMD_DRIVE 0x89 |
Definition at line 115 of file openinterface.h.
| #define s_OI_CMD_DRIVE_DIRECT 0x91 |
Definition at line 116 of file openinterface.h.
| #define s_OI_CMD_LEDS 0x8B |
Definition at line 117 of file openinterface.h.
| #define s_OI_CMD_LSD 0x8A |
Definition at line 120 of file openinterface.h.
| #define s_OI_CMD_MODE_FULL 0x84 |
Definition at line 113 of file openinterface.h.
| #define s_OI_CMD_MODE_PASSIVE 0x80 |
Definition at line 114 of file openinterface.h.
| #define s_OI_CMD_MODE_SAFE 0x83 |
Definition at line 112 of file openinterface.h.
| #define s_OI_CMD_PAUSE_RESUME_STREAM 0x96 |
Definition at line 127 of file openinterface.h.
| #define s_OI_CMD_PLAY_SCRIPT 0x99 |
Definition at line 129 of file openinterface.h.
| #define s_OI_CMD_PLAY_SONG 0x8D |
Definition at line 123 of file openinterface.h.
| #define s_OI_CMD_PWM_LSD 0x90 |
Definition at line 119 of file openinterface.h.
| #define s_OI_CMD_QUERY_LIST 0x95 |
Definition at line 125 of file openinterface.h.
| #define s_OI_CMD_SCRIPT 0x98 |
Definition at line 128 of file openinterface.h.
| #define s_OI_CMD_SEND_IR 0x97 |
Definition at line 121 of file openinterface.h.
| #define s_OI_CMD_SENSORS 0x8E |
Definition at line 124 of file openinterface.h.
| #define s_OI_CMD_SHOW_SCRIPT 0x9A |
Definition at line 130 of file openinterface.h.
| #define s_OI_CMD_SONG 0x8C |
Definition at line 122 of file openinterface.h.
| #define s_OI_CMD_START 0x80 |
Definition at line 111 of file openinterface.h.
| #define s_OI_CMD_STREAM 0x94 |
Definition at line 126 of file openinterface.h.
| #define s_OI_CMD_WAIT_ANGLE 0x9D |
Definition at line 133 of file openinterface.h.
| #define s_OI_CMD_WAIT_DIST 0x9C |
Definition at line 132 of file openinterface.h.
| #define s_OI_CMD_WAIT_EVENT 0x9E |
Definition at line 134 of file openinterface.h.
| #define s_OI_CMD_WAIT_TIME 0x9B |
Definition at line 131 of file openinterface.h.
| #define s_OI_SENSOR_PACKET_0 0 |
Definition at line 137 of file openinterface.h.
| #define s_OI_SENSOR_PACKET_0_SIZE 26 |
Definition at line 146 of file openinterface.h.
| #define s_OI_SENSOR_PACKET_1 1 |
Definition at line 138 of file openinterface.h.
| #define s_OI_SENSOR_PACKET_1_SIZE 10 |
Definition at line 147 of file openinterface.h.
| #define s_OI_SENSOR_PACKET_2 2 |
Definition at line 139 of file openinterface.h.
| #define s_OI_SENSOR_PACKET_2_SIZE 6 |
Definition at line 148 of file openinterface.h.
| #define s_OI_SENSOR_PACKET_3 3 |
Definition at line 140 of file openinterface.h.
| #define s_OI_SENSOR_PACKET_3_SIZE 10 |
Definition at line 149 of file openinterface.h.
| #define s_OI_SENSOR_PACKET_4 4 |
Definition at line 141 of file openinterface.h.
| #define s_OI_SENSOR_PACKET_4_SIZE 14 |
Definition at line 150 of file openinterface.h.
| #define s_OI_SENSOR_PACKET_5 5 |
Definition at line 142 of file openinterface.h.
| #define s_OI_SENSOR_PACKET_5_SIZE 12 |
Definition at line 151 of file openinterface.h.
| #define s_OI_SENSOR_PACKET_6 6 |
Definition at line 143 of file openinterface.h.
| #define s_OI_SENSOR_PACKET_6_SIZE 52 |
Definition at line 152 of file openinterface.h.
| typedef struct s_OPENINTERFACE_SENSOR_STRUCT openinterface_sensor_t |
Open Interface Sensor structure.
| typedef struct s_OPENINTERFACE_STRUCT openinterface_t |
Open Interface structure.
| int openinterface_angle_get | ( | openinterface_t * | ois | ) |
Get change of angle
| opis | Pointer to OpenInterface structure |
Definition at line 320 of file openinterface.c.
| int openinterface_close | ( | openinterface_t * | ois | ) |
Close OpenInterface connection
| opis | Pointer to openInterface structure |
Definition at line 63 of file openinterface.c.
| int openinterface_distance_get | ( | openinterface_t * | ois | ) |
Get travelled distance
| opis | Pointer to OpenInterface structure |
Definition at line 301 of file openinterface.c.
| int openinterface_drive | ( | openinterface_t * | ois, |
| int | velocity, | ||
| int | radius | ||
| ) |
Sends Drive Command
| opis | Pointer to OpenInterface structure |
| velocity | Drive velocity |
| radius | Radius of circle (curve) |
Definition at line 119 of file openinterface.c.
| int openinterface_drive_direct | ( | openinterface_t * | ois, |
| int | right, | ||
| int | left | ||
| ) |
Sends Direct Drive Command
| opis | Pointer to OpenInterface structure |
| right | Right wheel velocity |
| left | left wheel velocity |
Definition at line 150 of file openinterface.c.
| int openinterface_full | ( | openinterface_t * | ois | ) |
Enable full control of OpenInterface
| opis | Pointer to OpenInterface structure |
Definition at line 103 of file openinterface.c.
| int openinterface_LEDs | ( | openinterface_t * | ois, |
| int | play, | ||
| int | advance, | ||
| unsigned char | power_color, | ||
| unsigned char | power_intensity | ||
| ) |
Control LEDs
| opis | Pointer to OpenInterface structure |
| play | Light up PLAY LED (0 - off, 1 - on) |
| advance | Light up ADVANCE LED (0 - off, 1 - on) |
| power_color | Color of POWER LED (0 - green, 255 - red, intermediate values - intermediate colors) |
| power_intensity | Intensity of POWER LED (0-255) |
Definition at line 343 of file openinterface.c.
| openinterface_t* openinterface_open | ( | char * | device_path | ) |
Open OpenInterface connection
| device_path | Path to device |
Definition at line 35 of file openinterface.c.
| int openinterface_sensor_get | ( | openinterface_t * | ois, |
| const unsigned char | id, | ||
| const unsigned char | len, | ||
| unsigned char * | data | ||
| ) |
Get one sensor request readings
| opis | Pointer to OpenInterface structure |
| id | ID of the sensor packet |
| len | Number of bytes to be read |
| data | Ponter to memory where to store data |
Definition at line 182 of file openinterface.c.
| int openinterface_sensors_update | ( | openinterface_t * | ois, |
| const unsigned int | sensor_id, | ||
| const unsigned int | size | ||
| ) |
Updates all sensor data
| opis | Pointer to OpenInterface structure |
| oiss | Pointer to OpenInterface sensor structure |
| sensor_id | ID of sensor packet |
| size | Number of bytes in sensor packet |
Definition at line 231 of file openinterface.c.
| int openinterface_start | ( | openinterface_t * | ois | ) |
Start OpenInterface connection
| opis | Pointer to OpenInterface structure |
Definition at line 89 of file openinterface.c.
1.8.5