|
MFCPP
1.0
|
Corentin Chauvin-Hameau – 2019-2020
|
|
Coverage Path Planning for an underwater robot surveying a marine farm
|
|
Class for spline interpolation. More...
#include <spline.hpp>
Public Member Functions | |
| Spline () | |
| Default constructor. More... | |
| Spline (const std::vector< Eigen::Vector3f > &positions, const std::vector< Eigen::Vector3f > &orientations, float speed) | |
| Constructor for a spline given by a list of poses. More... | |
| void | set_poses (const std::vector< Eigen::Vector3f > &positions, const std::vector< Eigen::Vector3f > &orientations) |
| Sets the poses to interpolate. More... | |
| void | set_speed (float speed) |
| Set the desired speed on the path. More... | |
| void | evaluate (float t, Eigen::Vector3f &position, Eigen::Vector3f &orientation, bool &last_reached) |
| Evaluates the spline at a specific time instant (assuming constant speed) More... | |
Private Member Functions | |
| void | compute_parameters () |
| Computes the spline parameters. More... | |
| void | prepare () |
| Prepares the class for interpolation. More... | |
| Eigen::Vector3f | evaluate_position (float s) |
| Evaluates the spline at a specific curvilinear abscissa. More... | |
| Eigen::Vector3f | compute_orientation (float s) |
| Computes the orientation at a specific curvilinear abscissa. More... | |
| void | deriv_abscissa (const std::vector< double > &s, std::vector< double > &dsdt, const double t) |
| Computes the derivative of the curvilinear abscissa wrt time. More... | |
| float | compute_abscissa (float t) |
| Computes the curvilinear abscissa corresponding to a time instant. More... | |
Private Attributes | |
| int | n_ |
| Number of poses to interpolate. More... | |
| float | speed_ |
| Constant speed to adopt on the path. More... | |
| std::vector< Eigen::Vector3f > | p_ |
| Positions to interpolate. More... | |
| std::vector< Eigen::Vector3f > | o_ |
| Corresponding orientations. More... | |
| std::vector< std::vector< Eigen::Vector3f > > | a_ |
| Spline parameters for each segment (ie between each pose) More... | |
| bool | prepared_ |
| Whether the class is ready for interpolation. More... | |
| float | last_s_ |
| Curvilinear abscissa of the last evaluated point. More... | |
| float | last_t_ |
| Time instant of the last evaluated point. More... | |
Class for spline interpolation.
Interpolates a list of given positions and orientations by cubic splines at constant speed. The evaluation function is optimised for successive calls with increasing time.
Definition at line 24 of file spline.hpp.
| mfcpp::Spline::Spline | ( | ) |
Default constructor.
Definition at line 22 of file spline.cpp.
| mfcpp::Spline::Spline | ( | const std::vector< Eigen::Vector3f > & | positions, |
| const std::vector< Eigen::Vector3f > & | orientations, | ||
| float | speed | ||
| ) |
Constructor for a spline given by a list of poses.
Will call Spline::prepare().
| positions | Positions to interpolate |
| orientations | Corresponding orientations |
| speed | Desired constant speed |
Definition at line 29 of file spline.cpp.
|
private |
Computes the curvilinear abscissa corresponding to a time instant.
The function is optimised for successive calls with an increasing s.
| t | Time at which to interpolate (should be positive) |
Definition at line 150 of file spline.cpp.
|
private |
Computes the orientation at a specific curvilinear abscissa.
| s | Curvilinear abscissa (in [0, n]) |
Definition at line 127 of file spline.cpp.
|
private |
Computes the spline parameters.
Definition at line 101 of file spline.cpp.
|
private |
Computes the derivative of the curvilinear abscissa wrt time.
This is the ODE used to compute the abscissa corresponding to at time.
| [in] | Abscissa | at which to compute the derivative (vector of size 1) |
| [out] | Derivative | of the abscissa (vector of size 1) |
| [in] | Time | parameter (not used here since no time dependency) |
Definition at line 141 of file spline.cpp.
| void mfcpp::Spline::evaluate | ( | float | t, |
| Eigen::Vector3f & | position, | ||
| Eigen::Vector3f & | orientation, | ||
| bool & | last_reached | ||
| ) |
Evaluates the spline at a specific time instant (assuming constant speed)
If t is larger than the time t_max when the last specified pose is reached, the output pose will be this last pose.
| [in] | t | Time instant (should be positive) |
| [out] | position | Interpolated position |
| [out] | orientation | Interpolated orientation |
| [out] | last_reached | Whether the last pose has been reached |
Definition at line 63 of file spline.cpp.
|
private |
Evaluates the spline at a specific curvilinear abscissa.
| s | Curvilinear abscissa (in [0, n]) |
Definition at line 114 of file spline.cpp.
|
private |
Prepares the class for interpolation.
Computes the spline parameters and the time instants at the given points.
Definition at line 90 of file spline.cpp.
| void mfcpp::Spline::set_poses | ( | const std::vector< Eigen::Vector3f > & | positions, |
| const std::vector< Eigen::Vector3f > & | orientations | ||
| ) |
Sets the poses to interpolate.
| positions | Positions to interpolate |
| orientations | Corresponding orientations |
Definition at line 40 of file spline.cpp.
| void mfcpp::Spline::set_speed | ( | float | speed | ) |
Set the desired speed on the path.
| speed | Desired speed |
Definition at line 56 of file spline.cpp.
|
private |
Spline parameters for each segment (ie between each pose)
Definition at line 86 of file spline.hpp.
|
private |
Curvilinear abscissa of the last evaluated point.
Definition at line 88 of file spline.hpp.
|
private |
Time instant of the last evaluated point.
Definition at line 89 of file spline.hpp.
|
private |
Number of poses to interpolate.
Definition at line 82 of file spline.hpp.
|
private |
Corresponding orientations.
Definition at line 85 of file spline.hpp.
|
private |
Positions to interpolate.
Definition at line 84 of file spline.hpp.
|
private |
Whether the class is ready for interpolation.
Definition at line 87 of file spline.hpp.
|
private |
Constant speed to adopt on the path.
Definition at line 83 of file spline.hpp.
1.8.11