Functions | Variables
PhidgetServo.cpp File Reference
#include "ros/ros.h"
#include <stdio.h>
#include <phidget21.h>
#include "corobot_msgs/ServoPosition.h"
#include "corobot_msgs/ServoType.h"
#include <diagnostic_updater/diagnostic_updater.h>
#include <diagnostic_updater/publisher.h>
#include <corobot_diagnostics/diagnostics.h>
Include dependency graph for PhidgetServo.cpp:

Go to the source code of this file.

Functions

int ErrorHandler (CPhidgetHandle SERV, void *userptr, int ErrorCode, const char *Description)
 Phidget error Callback.
int main (int argc, char *argv[])
int PositionChangeHandler (CPhidgetAdvancedServoHandle phid, void *userPtr, int index, double position)
 Each time a servo motor changes position, this function is called and a message is publish on the /phidgetServo_getPosition topic.
void servo_diagnostic (diagnostic_updater::DiagnosticStatusWrapper &stat)
 Function that will report the status of the hardware to the diagnostic topic.
void setPositionCallback (const corobot_msgs::ServoPosition &msg)
 Callback for the topic /phidgetServo_setPosition The position of the concerned servo motor is set each time a message is received on this topic.
void setTypeCallback (const corobot_msgs::ServoType &msg)
 Callback for the topic /phidgetServo_setType The type of the concerned servo motor is set each time a message is received on this topic.

Variables

ros::Publisher position_pub
CPhidgetAdvancedServoHandle servo = 0
int servoError = 0

Function Documentation

int ErrorHandler ( CPhidgetHandle  SERV,
void *  userptr,
int  ErrorCode,
const char *  Description 
)

Phidget error Callback.

Definition at line 85 of file PhidgetServo.cpp.

int main ( int  argc,
char *  argv[] 
)

Definition at line 125 of file PhidgetServo.cpp.

int PositionChangeHandler ( CPhidgetAdvancedServoHandle  phid,
void *  userPtr,
int  index,
double  position 
)

Each time a servo motor changes position, this function is called and a message is publish on the /phidgetServo_getPosition topic.

Definition at line 54 of file PhidgetServo.cpp.

Function that will report the status of the hardware to the diagnostic topic.

Definition at line 107 of file PhidgetServo.cpp.

void setPositionCallback ( const corobot_msgs::ServoPosition &  msg)

Callback for the topic /phidgetServo_setPosition The position of the concerned servo motor is set each time a message is received on this topic.

Parameters:
corobot_msgs::ServoPositionMessage

Definition at line 71 of file PhidgetServo.cpp.

void setTypeCallback ( const corobot_msgs::ServoType &  msg)

Callback for the topic /phidgetServo_setType The type of the concerned servo motor is set each time a message is received on this topic.

Parameters:
corobot_msgs::ServoTypeMessage

Definition at line 98 of file PhidgetServo.cpp.


Variable Documentation

Definition at line 45 of file PhidgetServo.cpp.

CPhidgetAdvancedServoHandle servo = 0

Definition at line 42 of file PhidgetServo.cpp.

int servoError = 0

Definition at line 48 of file PhidgetServo.cpp.



phidget_servo
Author(s):
autogenerated on Sun Oct 5 2014 23:18:01