ASCO Aerial Autonomy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | List of all members
SampleParser Class Reference

An example UAV hardware that emulates actual UAV hardware. More...

#include <sample_parser.h>

Inheritance diagram for SampleParser:
Inheritance graph
[legend]
Collaboration diagram for SampleParser:
Collaboration graph
[legend]

Public Member Functions

 SampleParser ()
 Implict constructor. More...
 
void setRC (int16_t channels[4])
 set the rc channel information stored in the UAV brain More...
 
virtual bool takeoff ()
 Takeoff. More...
 
virtual bool land ()
 Land. More...
 
virtual bool disarm ()
 Turn off motor. More...
 
virtual bool flowControl (bool)
 Toggle software control. More...
 
virtual bool calibrateimubias ()
 Recalibrate IMU. More...
 
virtual bool cmdrpythrust (geometry_msgs::Quaternion &rpytmsg, bool sendyaw=false)
 Command the euler angles of the quad and the thrust. More...
 
virtual bool cmdvelguided (geometry_msgs::Vector3 &vel_cmd, double &yaw_ang)
 Command velocity and yaw to UAV. More...
 
virtual bool cmdwaypoint (geometry_msgs::Vector3 &desired_pos, double desired_yaw=0)
 Command position yaw for UAV. More...
 
virtual void grip (int state)
 Toggle gripper. More...
 
virtual void reset_attitude (double roll, double pitch, double yaw)
 Set the attitude data to specified roll, pitch, yaw (rad) More...
 
virtual void setmode (std::string mode)
 Set UAV controller mode such position controlling, rpyt etc. More...
 
virtual void initialize (ros::NodeHandle &nh_)
 Initialize the Hardware with a ros node handle to setup communications. More...
 
virtual void getquaddata (parsernode::common::quaddata &d1)
 Get the sensor data and UAV state. More...
 
virtual ~SampleParser ()
 Polymorphic destructor. More...
 
virtual void setBatteryPercent (double percent)
 Set the battery percent sensor data. More...
 
virtual void setaltitude (double altitude_)
 set the altitude or local z height data(m) More...
 
virtual void setlogdir (string logdir)
 Create log directory and create log files. More...
 
virtual void controllog (bool logswitch)
 Toggle logging. More...
 

Detailed Description

An example UAV hardware that emulates actual UAV hardware.

Constructor & Destructor Documentation

SampleParser::SampleParser ( )
inline

Implict constructor.

virtual SampleParser::~SampleParser ( )
inlinevirtual

Polymorphic destructor.

Member Function Documentation

virtual bool SampleParser::calibrateimubias ( )
inlinevirtual

Recalibrate IMU.

Returns
true if calibration successful
virtual bool SampleParser::cmdrpythrust ( geometry_msgs::Quaternion &  rpytmsg,
bool  sendyaw = false 
)
inlinevirtual

Command the euler angles of the quad and the thrust.

Parameters
rpytmsgMsg format is (x,y,z,w) -> (roll, pitch, yaw, thrust). The thrust value will be adjusted based on whethere there is thrust bias or not.
sendyawTrue to control the yaw/ False to ignore yaw command
Returns
True if sending command is successful
virtual bool SampleParser::cmdvelguided ( geometry_msgs::Vector3 &  vel_cmd,
double &  yaw_ang 
)
inlinevirtual

Command velocity and yaw to UAV.

Parameters
vel_cmdVelocity vector (m/s)
yaw_angYaw angle (rad)
Returns
True if sending command is successful
virtual bool SampleParser::cmdwaypoint ( geometry_msgs::Vector3 &  desired_pos,
double  desired_yaw = 0 
)
inlinevirtual

Command position yaw for UAV.

Parameters
desired_posDesired 3D position (m)
desired_yawDesired yaw angle (rad)
Returns
True if sending command is successful
virtual void SampleParser::controllog ( bool  logswitch)
inlinevirtual

Toggle logging.

Parameters
logswitchTrue to start logging/False to stop logging
virtual bool SampleParser::disarm ( )
inlinevirtual

Turn off motor.

Returns
True if disabling is successful
virtual bool SampleParser::flowControl ( bool  )
inlinevirtual

Toggle software control.

Returns
True if successful
virtual void SampleParser::getquaddata ( parsernode::common::quaddata &  d1)
inlinevirtual

Get the sensor data and UAV state.

Parameters
d1Data struct in which data is filled
virtual void SampleParser::grip ( int  state)
inlinevirtual

Toggle gripper.

Parameters
state0 to close, 1 to open
virtual void SampleParser::initialize ( ros::NodeHandle &  nh_)
inlinevirtual

Initialize the Hardware with a ros node handle to setup communications.

Parameters
nh_Nodehandle to setup communications
virtual bool SampleParser::land ( )
inlinevirtual

Land.

Returns
True if landing successful
virtual void SampleParser::reset_attitude ( double  roll,
double  pitch,
double  yaw 
)
inlinevirtual

Set the attitude data to specified roll, pitch, yaw (rad)

Parameters
rollRoll angle (rad)
pitchPitch angle (rad)
yawYaw angle (rad)
virtual void SampleParser::setaltitude ( double  altitude_)
inlinevirtual

set the altitude or local z height data(m)

Parameters
altitude_Altitude(m)
virtual void SampleParser::setBatteryPercent ( double  percent)
inlinevirtual

Set the battery percent sensor data.

Parameters
percent
virtual void SampleParser::setlogdir ( string  logdir)
inlinevirtual

Create log directory and create log files.

Parameters
logdirthe directory where to create log files
virtual void SampleParser::setmode ( std::string  mode)
inlinevirtual

Set UAV controller mode such position controlling, rpyt etc.

Parameters
modeThis version does not support any modes
void SampleParser::setRC ( int16_t  channels[4])
inline

set the rc channel information stored in the UAV brain

Parameters
channelsrc channel values (-10000, 10000)
virtual bool SampleParser::takeoff ( )
inlinevirtual

Takeoff.

Returns
True if successful

The documentation for this class was generated from the following file: