Corentin Chauvin-Hameau – 2019-2020
Coverage Path Planning for an underwater robot surveying a marine farm
Classes | Typedefs | Functions
mfcpp Namespace Reference

Classes

struct  Alga
 Alga hanging on a line. More...
 
struct  AlgaeLine
 Line on which algae grow. More...
 
class  CameraNodelet
 Nodelet for a simulated camera. More...
 
class  CartControlNodelet
 Nodelet for cheated cartesian control of a robot. More...
 
class  ClockPublisherNode
 Class to publish on the /clock topic. More...
 
class  ExperimentStatsNode
 Class to measure statistics about experiments. More...
 
class  FarmNodelet
 Nodelet class for farm simulation. More...
 
class  GPNodelet
 Nodelet for a Gaussian Process mapping an algae wall. More...
 
class  Lattice
 Class to represent a lattice. More...
 
class  LatticeNode
 Class to represent a node (viewpoint) of a lattice. More...
 
struct  MarkerArgs
 Arguments used to create a Rviz maker. More...
 
class  MPCNode
 Node for Model Predictive Control of a robot. More...
 
class  PerlinNoiseGenerator
 Perlin noise generator. More...
 
class  PlanningLogic
 Base class for a node managing high level planning logic. More...
 
class  PlanningNodelet
 Nodelet for path planning of an underwater robot surveying a marine farm. More...
 
class  RobotModel
 Class defining the robot model. More...
 
class  RobotSimulator
 Robot simulator. More...
 
struct  Rope
 Rope tensed between two 3D points. More...
 
class  Spline
 Class for spline interpolation. More...
 
class  TrajPublisherNode
 Class to publish hard-coded trajectories. More...
 

Typedefs

typedef std::unique_ptr< rp3d::BoxShape > box_shape_ptr
 

Functions

geometry_msgs::Pose to_pose (const geometry_msgs::TransformStamped &transform)
 Converts a TransformStamped message to a Pose message. More...
 
template<class T >
modulo_2pi (T angle)
 Brings back an angle into [-pi, pi) More...
 
float distance2 (const geometry_msgs::Point &p1, const geometry_msgs::Point &p2)
 Computes the square of the euclidean distance between two positions. More...
 
float distance (const geometry_msgs::Point &p1, const geometry_msgs::Point &p2)
 Computes the the euclidean distance between two positions. More...
 
float distance (const geometry_msgs::Pose &p1, const geometry_msgs::Pose &p2)
 Computes the the euclidean distance between the position of two poses. More...
 
geometry_msgs::Pose interpolate (const geometry_msgs::Pose &pose1, const geometry_msgs::Pose &pose2, float t)
 Interpolates linearily two poses. More...
 
tf2::Quaternion slerp (const tf2::Quaternion &q0, const tf2::Quaternion &q1, float t)
 Spherical Linear Interpolation of two quaternions. More...
 
void to_euler (const tf2::Quaternion &quat, double &roll, double &pitch, double &yaw)
 Converts a quaternion to Roll-Pitch-Yaw Euler angles. More...
 
void to_euler (const geometry_msgs::Quaternion &quat, double &roll, double &pitch, double &yaw)
 Converts a quaternion to Roll-Pitch-Yaw Euler angles. More...
 
void to_quaternion (double roll, double pitch, double yaw, tf2::Quaternion &quat)
 Converts Roll-Pitch-Yaw Euler angles to a quaternion. More...
 
void to_quaternion (double roll, double pitch, double yaw, geometry_msgs::Quaternion &quat)
 Converts Roll-Pitch-Yaw Euler angles to a quaternion. More...
 
void to_quaternion (float x, float y, float z, float angle, geometry_msgs::Quaternion &quat)
 Converts Axis-angle to a quaternion. More...
 
template<class VectorT >
void get_orientation (float roll, float pitch, float yaw, VectorT &orientation)
 Get orientation vector (x vector of the frame) given by Roll-Pitch-Yaw. More...
 
void diff_pose (const geometry_msgs::Pose &p1, const geometry_msgs::Pose &p2, geometry_msgs::Pose &diff)
 Computes the difference between two poses. More...
 
void diff_pose (const geometry_msgs::Pose &p1, const geometry_msgs::Pose &p2, mf_common::EulerPose &diff)
 Computes the difference between two poses. More...
 
template<class T >
void fill_diag_mat (const std::vector< T > &v, Eigen::DiagonalMatrix< T, Eigen::Dynamic > &D)
 Fills a Eigen DiagonalMatrix from a std::Vector. More...
 
template<class T , class MatrixT >
void fill_diag_mat (const std::vector< T > &v, MatrixT &D)
 Fills a Eigen matrix from a std::Vector. More...
 
std::vector< tf2::Vector3 > get_alga_coord (const AlgaeLine &line, const Alga &alga)
 Computes the corner coordinates of an alga. More...
 
std::ostream & operator<< (std::ostream &stream, const tf2::Vector3 &v)
 Displays a vector. More...
 
geometry_msgs::Point32 vector3_to_point32 (tf2::Vector3 p)
 Convert a tf2::Vector3 to a geometry_msgs::Point32. More...
 
void fill_marker_header (visualization_msgs::Marker &marker, const MarkerArgs &common_args)
 Fill header of marker. More...
 
visualization_msgs::Marker rviz_marker_spheres (float thickness, const MarkerArgs &common_args)
 Creates a blank Rviz marker to display spheres. More...
 
visualization_msgs::Marker rviz_marker_line (float thickness, const MarkerArgs &common_args)
 Creates a blank Rviz marker to display lines. More...
 
visualization_msgs::Marker rviz_marker_line (tf2::Vector3 p1, tf2::Vector3 p2, float thickness, const MarkerArgs &common_args)
 Creates a Rviz marker to display a line. More...
 
visualization_msgs::Marker rviz_marker_cylinder (tf2::Vector3 p, float diameter, float height, const MarkerArgs &common_args)
 Creates a Rviz marker to display a cylinder. More...
 
visualization_msgs::Marker rviz_marker_triangles (const MarkerArgs &common_args)
 Creates a blank Rviz marker to display triangles. More...
 
visualization_msgs::Marker rviz_marker_rect (const MarkerArgs &common_args)
 Creates a blank Rviz marker to display rectangles. More...
 
visualization_msgs::Marker rviz_marker_rect (tf2::Vector3 p1, tf2::Vector3 p2, tf2::Vector3 p3, tf2::Vector3 p4, const MarkerArgs &common_args)
 Creates a Rviz marker to display a rectangle. More...
 
void pop_marker_ids (visualization_msgs::MarkerArray &array)
 Populates id of all the markers in a marker array. More...
 
ostream & operator<< (ostream &stream, const tf2::Vector3 &v)
 
RobotModel::state_type to_state (const geometry_msgs::Pose &pose, int state_size)
 Converts a pose into a state message. More...
 

Typedef Documentation

typedef std::unique_ptr<rp3d::BoxShape> mfcpp::box_shape_ptr

Definition at line 31 of file camera_nodelet.hpp.

Function Documentation

void mfcpp::diff_pose ( const geometry_msgs::Pose &  p1,
const geometry_msgs::Pose &  p2,
geometry_msgs::Pose &  diff 
)
inline

Computes the difference between two poses.

Parameters
[in]p1First pose
[in]p2Second pose
[out]diffDifference between p1 and p2

Definition at line 273 of file common.hpp.

void mfcpp::diff_pose ( const geometry_msgs::Pose &  p1,
const geometry_msgs::Pose &  p2,
mf_common::EulerPose &  diff 
)
inline

Computes the difference between two poses.

Parameters
[in]p1First pose
[in]p2Second pose
[out]diffDifference between p1 and p2

Definition at line 297 of file common.hpp.

float mfcpp::distance ( const geometry_msgs::Point &  p1,
const geometry_msgs::Point &  p2 
)
inline

Computes the the euclidean distance between two positions.

Definition at line 69 of file common.hpp.

float mfcpp::distance ( const geometry_msgs::Pose &  p1,
const geometry_msgs::Pose &  p2 
)
inline

Computes the the euclidean distance between the position of two poses.

Definition at line 77 of file common.hpp.

float mfcpp::distance2 ( const geometry_msgs::Point &  p1,
const geometry_msgs::Point &  p2 
)
inline

Computes the square of the euclidean distance between two positions.

Definition at line 61 of file common.hpp.

template<class T >
void mfcpp::fill_diag_mat ( const std::vector< T > &  v,
Eigen::DiagonalMatrix< T, Eigen::Dynamic > &  D 
)
inline

Fills a Eigen DiagonalMatrix from a std::Vector.

Parameters
[in]vVector containing the diagonal terms of the matrix
[out]DDiagonal matrix to fill

Definition at line 322 of file common.hpp.

template<class T , class MatrixT >
void mfcpp::fill_diag_mat ( const std::vector< T > &  v,
MatrixT &  D 
)
inline

Fills a Eigen matrix from a std::Vector.

Parameters
[in]vVector containing the diagonal terms of the matrix
[out]DSquare diagonal matrix to fill

Definition at line 341 of file common.hpp.

void mfcpp::fill_marker_header ( visualization_msgs::Marker &  marker,
const MarkerArgs common_args 
)

Fill header of marker.

Parameters
markerThe marker to fill
common_argsCommon arguments to fill ROS message

Definition at line 19 of file rviz_visualisation.cpp.

vector< tf2::Vector3 > mfcpp::get_alga_coord ( const AlgaeLine line,
const Alga alga 
)

Computes the corner coordinates of an alga.

coord[0] | coord[1] –> line

coord[3] | coord[2]

Parameters
lineAlgae line on which the algae is
algaAlga to find the coordinates
Returns
Coordinates of the alga

Definition at line 20 of file farm_common.cpp.

template<class VectorT >
void mfcpp::get_orientation ( float  roll,
float  pitch,
float  yaw,
VectorT &  orientation 
)
inline

Get orientation vector (x vector of the frame) given by Roll-Pitch-Yaw.

VectorT can be either Eigen::Vector3f or Eigen::Vector3d

Parameters
[in]rollRoll angle to convert
[in]pitchPitch angle to convert
[in]yawYaw angle to convert
[out]orientationResulting orientation

Definition at line 256 of file common.hpp.

geometry_msgs::Pose mfcpp::interpolate ( const geometry_msgs::Pose &  pose1,
const geometry_msgs::Pose &  pose2,
float  t 
)
inline

Interpolates linearily two poses.

The position is linearily interpolated, the orientation is interpolated using Spherical Linear Interpolation.

Parameters
pose1First pose
pose2Second pose
tInterpolation coefficient
Returns
Interpolated pose

Definition at line 93 of file common.hpp.

template<class T >
T mfcpp::modulo_2pi ( angle)
inline

Brings back an angle into [-pi, pi)

Definition at line 46 of file common.hpp.

ostream& mfcpp::operator<< ( ostream &  stream,
const tf2::Vector3 &  v 
)

Definition at line 41 of file farm_common.cpp.

std::ostream& mfcpp::operator<< ( std::ostream &  stream,
const tf2::Vector3 &  v 
)

Displays a vector.

Parameters
streamStream on which to display the vector
vVector to display
Returns
Output stream
void mfcpp::pop_marker_ids ( visualization_msgs::MarkerArray &  array)

Populates id of all the markers in a marker array.

Note
The id of each marker needs to be different for Rviz to display it correctly.

Definition at line 179 of file rviz_visualisation.cpp.

visualization_msgs::Marker mfcpp::rviz_marker_cylinder ( tf2::Vector3  p,
float  diameter,
float  height,
const MarkerArgs common_args 
)

Creates a Rviz marker to display a cylinder.

The cylinder will be aligned with the z axis of the frame provided in common_args.

Parameters
pPosition of the center of the cylinder
diameterDiameter (in m)
heightHeight (in m)
common_argsCommon arguments to fill ROS message
Returns
Corresponding Rviz marker

Definition at line 87 of file rviz_visualisation.cpp.

visualization_msgs::Marker mfcpp::rviz_marker_line ( float  thickness,
const MarkerArgs common_args 
)

Creates a blank Rviz marker to display lines.

Parameters
thicknessThickness of the lines (in m)
common_argsCommon arguments to fill ROS message
Returns
Corresponding Rviz marker

Definition at line 72 of file rviz_visualisation.cpp.

visualization_msgs::Marker mfcpp::rviz_marker_line ( tf2::Vector3  p1,
tf2::Vector3  p2,
float  thickness,
const MarkerArgs common_args 
)

Creates a Rviz marker to display a line.

Parameters
p1First extremity of the line
p2Second extremity of the line
thicknessThickness of the line (in m)
common_argsCommon arguments to fill ROS message
Returns
Corresponding Rviz marker

Definition at line 46 of file rviz_visualisation.cpp.

visualization_msgs::Marker mfcpp::rviz_marker_rect ( const MarkerArgs common_args)

Creates a blank Rviz marker to display rectangles.

The rectangles will be made of two triangles

Parameters
common_argsCommon arguments to fill ROS message
Returns
Corresponding Rviz marker

Definition at line 109 of file rviz_visualisation.cpp.

visualization_msgs::Marker mfcpp::rviz_marker_rect ( tf2::Vector3  p1,
tf2::Vector3  p2,
tf2::Vector3  p3,
tf2::Vector3  p4,
const MarkerArgs common_args 
)

Creates a Rviz marker to display a rectangle.

The rectangle will be made of two triangles

Parameters
p1First point
p2Second point
p3Third point
p4Fourth point
common_argsCommon arguments to fill ROS message
Returns
Corresponding Rviz marker

Definition at line 143 of file rviz_visualisation.cpp.

visualization_msgs::Marker mfcpp::rviz_marker_spheres ( float  thickness,
const MarkerArgs common_args 
)

Creates a blank Rviz marker to display spheres.

Parameters
diameterDiameter of the spheres (in m)
common_argsCommon arguments to fill ROS message
Returns
Corresponding Rviz marker

Definition at line 29 of file rviz_visualisation.cpp.

visualization_msgs::Marker mfcpp::rviz_marker_triangles ( const MarkerArgs common_args)

Creates a blank Rviz marker to display triangles.

Parameters
common_argsCommon arguments to fill ROS message
Returns
Corresponding Rviz marker

Definition at line 126 of file rviz_visualisation.cpp.

tf2::Quaternion mfcpp::slerp ( const tf2::Quaternion &  q0,
const tf2::Quaternion &  q1,
float  t 
)
inline

Spherical Linear Interpolation of two quaternions.

Adapted from Wikipedia: https://en.wikipedia.org/wiki/Slerp

Parameters
q0First quaternion
q1Second quaternion
tInterpolation coefficient

Definition at line 124 of file common.hpp.

void mfcpp::to_euler ( const tf2::Quaternion &  quat,
double &  roll,
double &  pitch,
double &  yaw 
)
inline

Converts a quaternion to Roll-Pitch-Yaw Euler angles.

Parameters
[in]quatQuaternion to convert
[out]rollResulting roll angle
[out]pitchResulting pitch angle
[out]yawResulting yaw angle

Definition at line 180 of file common.hpp.

void mfcpp::to_euler ( const geometry_msgs::Quaternion &  quat,
double &  roll,
double &  pitch,
double &  yaw 
)
inline

Converts a quaternion to Roll-Pitch-Yaw Euler angles.

Parameters
[in]quatQuaternion to convert
[out]rollResulting roll angle
[out]pitchResulting pitch angle
[out]yawResulting yaw angle

Definition at line 193 of file common.hpp.

geometry_msgs::Pose mfcpp::to_pose ( const geometry_msgs::TransformStamped &  transform)
inline

Converts a TransformStamped message to a Pose message.

Definition at line 28 of file common.hpp.

void mfcpp::to_quaternion ( double  roll,
double  pitch,
double  yaw,
tf2::Quaternion &  quat 
)
inline

Converts Roll-Pitch-Yaw Euler angles to a quaternion.

Parameters
[in]rollRoll angle to convert
[in]pitchPitch angle to convert
[in]yawYaw angle to convert
[out]quatResulting quaternion

Definition at line 207 of file common.hpp.

void mfcpp::to_quaternion ( double  roll,
double  pitch,
double  yaw,
geometry_msgs::Quaternion &  quat 
)
inline

Converts Roll-Pitch-Yaw Euler angles to a quaternion.

Parameters
[in]rollRoll angle to convert
[in]pitchPitch angle to convert
[in]yawYaw angle to convert
[out]quatResulting quaternion

Definition at line 220 of file common.hpp.

void mfcpp::to_quaternion ( float  x,
float  y,
float  z,
float  angle,
geometry_msgs::Quaternion &  quat 
)
inline

Converts Axis-angle to a quaternion.

Parameters
[in]xX coordinate of the axis vector
[in]yY coordinate of the axis vector
[in]zZ coordinate of the axis vector
[in]angleAngle around the axis vector
[out]quatResulting quaternion

Definition at line 236 of file common.hpp.

RobotModel::state_type mfcpp::to_state ( const geometry_msgs::Pose &  pose,
int  state_size 
)
inline

Converts a pose into a state message.

The first 6 components will be filled with the pose (x, y, z, roll, pitch, yaw). The other components of the state will be filled with zeros.

Parameters
[in]posePose to convert
[in]state_sizeSize of the state
Returns
Converted state

Definition at line 276 of file robot_model.hpp.

geometry_msgs::Point32 mfcpp::vector3_to_point32 ( tf2::Vector3  p)
inline

Convert a tf2::Vector3 to a geometry_msgs::Point32.

Note
tf2::ToMsg() implements a conversion to Point, but not Point32
Parameters
pVector3 to convert
Returns
Converted Point32

Definition at line 102 of file farm_common.hpp.