|
| 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...
|
| |
A Model plugin that is the base class for all agent plugins in a swarm.
This plugin exposes the following functionality to the derived plugins:
- Configuration.
- Load() This method will allow the agent to read SDF parameters from the model.
- Communication.
- Bind() This method binds an address to a virtual socket, and sends incoming messages to the specified callback.
- SendTo() This method allows an agent to send data to other individual agent (unicast), all the agents (broadcast), or a group of agents (multicast).
- Host() This method will return the agent's address.
- Neighbors() This method returns the addresses of other vehicles that are inside the communication range of this robot.
Motion.
Sensors.
- Pose() Get the robot's current pose from its GPS sensor.
- SearchArea() Get the search area, in GPS coordinates.
- Image() Get the list of detected objects, and other related information, from the camera sensor.
- CameraToWorld() Convert a pose in a robot's camera frame into the world frame.
- Imu() Get the robot's linear and angular velocities and position relative to a reference position (starting pose).
- Bearing() Get the angle between the true North and the robot.
Introspection.
| bool swarm::RobotPlugin::Imu |
( |
ignition::math::Vector3d & |
_linVel, |
|
|
ignition::math::Vector3d & |
_angVel, |
|
|
ignition::math::Quaterniond & |
_orient |
|
) |
| const |
|
protected |
Get the robot's IMU information.
The linear velocity is set in the robot's local coordinate frame, where
- x = forward/back velocity,
- y = left/right velociy,
- z = up/down velocity.
The angular velocity is set in the robot's local coordinate frame, where
- x = Velocity about x-axis (roll),
- y = Velocity about y-axis (pitch),
- z = Velocity about z-axis (yaw).
The orientation is set relative to the reference pose with a range from PI to -PI. The reference pose was initialized when the robot was spawned
- x = Offset with respect the reference pos about x-axis (roll),
- y = Offset with respect the reference pos about y-axis (pitch),
- z = Offset with respect the reference pos about z-axis (yaw).
- Parameters
-
| [out] | _linVel | Linear velocity in the robot's local coordinate frame (m/s). |
| [out] | _angVel | Angular velocity in the robot's local coordinate frame (m/s). |
| [out] | _orient | Offset with respect the reference pos. |
| bool swarm::RobotPlugin::SetAngularVelocity |
( |
const ignition::math::Vector3d & |
_velocity | ) |
|
|
protected |
Set the robot's angular velocity, using Euler angles.
The velocity is applied in the robot's local coordinate frame, where
- x = rotate about x-axis (roll),
- y = rotate about y-axis (pitch),
- z = rotate about z-axis (yaw).
This velocity will be constrained by the type of robot. For example, a ground vehicle will ignore the x and y components of the _velocity vector, but a quadcopter will use all three.
- Parameters
-
| [in] | _velocity | Velocity about the robot's local XYZ axes (radian/s). |
- Returns
- True if the command was successful. False if the angular velocity could not be set, such as due to low battery.
| bool swarm::RobotPlugin::SetAngularVelocity |
( |
const double |
_x, |
|
|
const double |
_y, |
|
|
const double |
_z |
|
) |
| |
|
protected |
Set the robot's angular velocity, using Euler angles.
The velocity is applied in the robot's local coordinate frame, where
- x = rotate about x-axis (roll),
- y = rotate about y-axis (pitch),
- z = rotate about z-axis (yaw).
This velocity will be constrained by the type of robot. For example, a ground vehicle will ignore the x and y components of the _velocity vector, but a quadcopter will use all three.
- Parameters
-
| [in] | _x | Velocity about the robot's local X axis (radian/s). |
| [in] | _y | Velocity about the robot's local Y axis (radian/s). |
| [in] | _z | Velocity about the robot's local Z axis (radian/s). |
- Returns
- True if the command was successful. False if the angular velocity could not be set, such as due to low battery.
| bool swarm::RobotPlugin::SetLinearVelocity |
( |
const ignition::math::Vector3d & |
_velocity | ) |
|
|
protected |
Set the robot's linear velocity.
The velocity is applied in the robot's local coordinate frame, where
- x = forward/back,
- y = left/right,
- z = up/down.
This velocity will be constrained by the type of robot. For example, a ground vehicle will ignore the y & z components of the _velocity vector, but a rotorcraft will use all three.
- Parameters
-
| [in] | _velocity | The velocity vector in the robot's local coordinate frame (m/s). |
- Returns
- True if the command was successful. False if the linear velocity could not be set, such as due to low battery.
| bool swarm::RobotPlugin::SetLinearVelocity |
( |
const double |
_x, |
|
|
const double |
_y, |
|
|
const double |
_z |
|
) |
| |
|
protected |
Set the robot's linear velocity.
The velocity is applied in the robot's local coordinate frame, where
- x = forward/back,
- y = left/right,
- z = up/down.
This velocity will be constrained by the type of robot. For example, a ground vehicle will ignore the y & z components of the _velocity vector, but a rotorcraft will use all three.
- Parameters
-
| [in] | _x | X velocity in the robot's local coordinate frame (m/s). |
| [in] | _y | Y velocity in the robot's local coordinate frame (m/s). |
| [in] | _z | Z velocity in the robot's local coordinate frame (m/s). |
- Returns
- True if the command was successful. False if the linear velocity could not be set, such as due to low battery.