Swarm API

Public Member Functions
swarm::BooPlugin Class Reference

Class that drives the behavior of the base of operations (BOO). More...

#include <BooPlugin.hh>

Inheritance diagram for swarm::BooPlugin:
Inheritance graph
[legend]

Public Member Functions

 BooPlugin ()
 Class constructor. More...
 
virtual ~BooPlugin ()
 Class destructor. More...
 
- Public Member Functions inherited from swarm::RobotPlugin
 RobotPlugin ()
 Class constructor. More...
 
virtual ~RobotPlugin ()
 Class destructor. More...
 

Additional Inherited Members

- Public Types inherited from swarm::RobotPlugin
enum  VehicleType { GROUND = 0, ROTOR = 1, FIXED_WING = 2 }
 The type of vehicle. More...
 
- Protected Member Functions inherited from swarm::RobotPlugin
double BatteryCapacity () const
 Get the current battery capacity (mAh). More...
 
double BatteryConsumption () const
 Get the vehicle's battery consumption (mA). More...
 
double BatteryConsumptionFactor () const
 Get the vehicle's battery consumption factor (unitless). More...
 
double BatteryStartCapacity () const
 Get starting battery capacity (mAh). More...
 
bool Bearing (ignition::math::Angle &_bearing) const
 Angle between the true North and the robot. More...
 
template<typename C >
bool Bind (void(C::*_cb)(const std::string &_srcAddress, const std::string &_dstAddress, const uint32_t _dstPort, const std::string &_data), C *_obj, const std::string &_address, const int _port=kDefaultPort)
 This method can bind a local address and a port to a virtual socket. More...
 
ignition::math::Pose3d CameraToWorld (const ignition::math::Pose3d &_poseinCamera) const
 Convert a pose in a robot's camera frame into the world frame. More...
 
double ExpectedBatteryLife () const
 Get the expected battery life in seconds. More...
 
std::string Host () const
 Get your local address. More...
 
bool Image (ImageData &_img) const
 Get the set of objects detected by the camera. More...
 
bool Imu (ignition::math::Vector3d &_linVel, ignition::math::Vector3d &_angVel, ignition::math::Quaterniond &_orient) const
 Get the robot's IMU information. More...
 
virtual void Load (sdf::ElementPtr _sdf)
 This method is called after the world has been loaded and gives child plugins access to the SDF model file. More...
 
std::string Name () const
 Get the name of this robot. More...
 
std::vector< std::string > Neighbors () const
 Get the list of local neighbors. More...
 
bool Pose (double &_latitude, double &_longitude, double &_altitude) const
 Get the robot's current pose from its GPS sensor. More...
 
void SearchArea (double &_minLatitude, double &_maxLatitude, double &_minLongitude, double &_maxLongitude)
 Get the search area, in GPS coordinates. More...
 
bool SendTo (const std::string &_data, const std::string &_dstAddress, const uint32_t _port=kDefaultPort)
 Send some data to other/s member/s of the swarm. More...
 
bool SetAngularVelocity (const ignition::math::Vector3d &_velocity)
 Set the robot's angular velocity, using Euler angles. More...
 
bool SetAngularVelocity (const double _x, const double _y, const double _z)
 Set the robot's angular velocity, using Euler angles. More...
 
bool SetLinearVelocity (const ignition::math::Vector3d &_velocity)
 Set the robot's linear velocity. More...
 
bool SetLinearVelocity (const double _x, const double _y, const double _z)
 Set the robot's linear velocity. More...
 
VehicleType Type () const
 Get the type of vehicle. More...
 
virtual void Update (const gazebo::common::UpdateInfo &_info)
 Update the plugin. More...
 
- Protected Attributes inherited from swarm::RobotPlugin
const std::string kBoo = "boo"
 Address used by the base of operations. More...
 
const std::string kBroadcast = "broadcast"
 Address used to send a message to all the members of the swarm listening on a specific port. More...
 
const std::string kMulticast = "multicast"
 Address used to bind to a multicast group. More...
 
- Static Protected Attributes inherited from swarm::RobotPlugin
static const uint32_t kBooPort = 4200
 Base of communications port. More...
 
static const uint32_t kDefaultPort = 4100
 Default port. More...
 
static const uint32_t kMtu = 1500
 Maximum transmission payload size (octets) for each message. More...
 

Detailed Description

Class that drives the behavior of the base of operations (BOO).

The BOO binds on its own address (kBoo) and port (kBooPort). It accepts messages of the format: <cmd> [args]

List of supported commands: FOUND <x> <y> <z> <t> : Person found in [x,y,z] at time t, where:

x: X coordinate (meters). y: Y coordinate (meters). z: Z coordinate (meters). t: Time when the person was seen (double).

E.g.: FOUND 100.0 50.0 1.0 10.4

The BOO also verifies that the position reported by a user match the position of the lost person. If the person is found, a message of type PersonFound is published in the topic /swarm/found and the simulation is paused.

Constructor & Destructor Documentation

swarm::BooPlugin::BooPlugin ( )

Class constructor.

virtual swarm::BooPlugin::~BooPlugin ( )
virtual

Class destructor.


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