Functions | Variables
PhidgetServo.cpp File Reference
#include "ros/ros.h"
#include <stdio.h>
#include <phidget21.h>
#include "corobot_srvs/GetEngaged.h"
#include "corobot_srvs/SetEngaged.h"
#include "corobot_srvs/GetPosition.h"
#include "corobot_srvs/SetPosition.h"
#include "corobot_srvs/GetMotorCount.h"
#include "corobot_srvs/SetParam.h"
#include "corobot_msgs/ServoPosition.h"
#include "corobot_srvs/GetSerialNumber.h"
#include "corobot_srvs/GetType.h"
#include "corobot_srvs/SetType.h"
#include "corobot_msgs/ServoType.h"
#include <diagnostic_updater/diagnostic_updater.h>
#include <diagnostic_updater/publisher.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.
bool GetEngaged (corobot_srvs::GetEngaged::Request &req, corobot_srvs::GetEngaged::Response &res)
 Get the status of a servo motor connected, to know if it is engaged ( powered on) or not.
bool GetMotorCount (corobot_srvs::GetMotorCount::Request &req, corobot_srvs::GetMotorCount::Response &res)
 Get the maximum number of servo motors that can be connected to this Phidget Servo controller.
bool GetPosition (corobot_srvs::GetPosition::Request &req, corobot_srvs::GetPosition::Response &res)
 Get the position of a servo motor.
bool GetPositionMax (corobot_srvs::GetPosition::Request &req, corobot_srvs::GetPosition::Response &res)
 Get the maximum position possible of a servo motor.
bool GetPositionMin (corobot_srvs::GetPosition::Request &req, corobot_srvs::GetPosition::Response &res)
 Get the minumum position possible of a servo motor.
bool GetSerialNumber (corobot_srvs::GetSerialNumber::Request &req, corobot_srvs::GetSerialNumber::Response &res)
 Get the serial number of the current phidget servo controller. Useful if there are two phidget servo controllers connected.
bool GetServoType (corobot_srvs::GetType::Request &req, corobot_srvs::GetType::Response &res)
 Get the type of servo motor pluged in.
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)
bool SetEngaged (corobot_srvs::SetEngaged::Request &req, corobot_srvs::SetEngaged::Response &res)
 Set the status of a servo motor, engaged( powered on) or not.
bool SetPosition (corobot_srvs::SetPosition::Request &req, corobot_srvs::SetPosition::Response &res)
 Set the position of a servo motor.
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.
bool SetServoParameters (corobot_srvs::SetParam::Request &req, corobot_srvs::SetParam::Response &res)
 Get the parameters of a servo motor.
bool SetServoType (corobot_srvs::SetType::Request &req, corobot_srvs::SetType::Response &res)
 Set the servo motor to one of the defined types.
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 151 of file PhidgetServo.cpp.

Get the status of a servo motor connected, to know if it is engaged ( powered on) or not.

Parameters:
corobot_srvs::GetEngagedService

Definition at line 29 of file PhidgetServo.cpp.

Get the maximum number of servo motors that can be connected to this Phidget Servo controller.

Parameters:
Pcorobot_srvs::GetMotorCountService

Definition at line 73 of file PhidgetServo.cpp.

Get the position of a servo motor.

Parameters:
corobot_srvs::GetPositionService

Definition at line 51 of file PhidgetServo.cpp.

Get the maximum position possible of a servo motor.

Parameters:
corobot_srvs::GetPositionService

Definition at line 86 of file PhidgetServo.cpp.

Get the minumum position possible of a servo motor.

Parameters:
corobot_srvs::GetPositionService

Definition at line 99 of file PhidgetServo.cpp.

Get the serial number of the current phidget servo controller. Useful if there are two phidget servo controllers connected.

Parameters:
corobot_srvs::GetSerialNumberService

Definition at line 161 of file PhidgetServo.cpp.

Get the type of servo motor pluged in.

Parameters:
corobot_srvs::GetTypeService

Definition at line 174 of file PhidgetServo.cpp.

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

Definition at line 229 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 120 of file PhidgetServo.cpp.

void servo_diagnostic ( diagnostic_updater::DiagnosticStatusWrapper &  stat)

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

Definition at line 202 of file PhidgetServo.cpp.

Set the status of a servo motor, engaged( powered on) or not.

Parameters:
corobot_srvs::SetEngagedService

Definition at line 42 of file PhidgetServo.cpp.

Set the position of a servo motor.

Parameters:
corobot_srvs::SetPositionService

Definition at line 64 of file PhidgetServo.cpp.

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 137 of file PhidgetServo.cpp.

Get the parameters of a servo motor.

Parameters:
corobot_srvs::SetParamService

Definition at line 112 of file PhidgetServo.cpp.

Set the servo motor to one of the defined types.

Parameters:
corobot_srvs::SetTypeService

Definition at line 187 of file PhidgetServo.cpp.

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 197 of file PhidgetServo.cpp.


Variable Documentation

Definition at line 22 of file PhidgetServo.cpp.

CPhidgetAdvancedServoHandle servo = 0

Definition at line 21 of file PhidgetServo.cpp.

int servoError = 0

Definition at line 23 of file PhidgetServo.cpp.



PhidgetServo
Author(s): Morgan Cormier/mcormier@coroware.com
autogenerated on Tue Jan 7 2014 11:39:10