#include <src/surveyor_driver.h>
Public Member Functions | |
Surveyor (ConfigFile *cf, int section) | |
Constructor for the Surveyor multi-interface driver. | |
int | Setup () |
Set up the device and start the device thread by calling StartThread(), which spawns a new thread and executes Surveyor::Main(), which contains the main loop for the driver. | |
int | Shutdown () |
Shut down the device. | |
int | ProcessMessage (QueuePointer &resp_queue, player_msghdr *hdr, void *data) |
Message handler that sends a response if necessary using Publish(). This function is called once for each message in the incoming queue. | |
Private Member Functions | |
virtual void | Main () |
Main "entry point" function for the driver thread created using StartThread() within the Setup() function;. | |
Private Attributes | |
const char * | portname |
Serial port. | |
player_devaddr_t | position_addr |
Address of the position device (wheels odometry). | |
player_devaddr_t | camera_addr |
Address of the camera device. | |
player_devaddr_t | ir_addr |
Address of the infrared (IR) beacons. | |
player_devaddr_t | dio_addr |
Address of the digital input/output pins (ports). | |
srv1_comm_t * | srvdev |
The surveyor object. | |
player_position2d_cmd_vel_t | position_cmd |
position2d velocity command | |
player_position2d_geom_t | pos_geom |
position2d geometry | |
int | setup_image_mode |
Desired camera size. |
These robots can be controlled via ZigBee which is attached to a USB serial port on a host computer. The host computer runs the server which then communicates to the robot.
driver ( name "surveyor" plugin "libSurveyor_Driver.so" provides ["position2d:0" "camera:0"] port "/dev/ttyUSB0" )
Definition at line 118 of file surveyor_driver.h.
Surveyor::Surveyor | ( | ConfigFile * | cf, | |
int | section | |||
) |
Constructor for the Surveyor multi-interface driver.
Constructor for the Surveyor driver. Retrieves options from the configuration file, allocates memory for each interface and then reads and adds the interfaces provided in the configuration file.
cf | Current configuration file | |
section | Current section in configuration file |
Definition at line 42 of file surveyor_driver.cc.
References camera_addr, dio_addr, ir_addr, portname, position_addr, setup_image_mode, and srvdev.
int Surveyor::ProcessMessage | ( | QueuePointer & | resp_queue, | |
player_msghdr * | hdr, | |||
void * | data | |||
) |
Message handler that sends a response if necessary using Publish(). This function is called once for each message in the incoming queue.
resp_queue | The queue to which any response should go | |
hdr | The message header | |
data | The message body |
Definition at line 232 of file surveyor_driver.cc.
References pos_geom, position_addr, position_cmd, and srvdev.
int Surveyor::Setup | ( | ) |
Set up the device and start the device thread by calling StartThread(), which spawns a new thread and executes Surveyor::Main(), which contains the main loop for the driver.
Definition at line 105 of file surveyor_driver.cc.
References srv1_comm_t::image_mode, portname, setup_image_mode, and srvdev.
int Surveyor::Shutdown | ( | ) |
Shut down the device.
Definition at line 130 of file surveyor_driver.cc.
References srvdev.