Commit 814137ce authored by Joseph Mirabel's avatar Joseph Mirabel
Browse files

[CarLike] Add accessors to turning radius

parent d75996f4
......@@ -43,6 +43,11 @@ namespace hpp {
std::vector <JointPtr_t> wheels);
static ReedsSheppPtr_t createCopy (const ReedsSheppPtr_t& distance);
void turningRadius(const value_type& rho);
inline value_type turningRadius() const { return rho_; }
protected:
ReedsShepp (const ProblemConstPtr_t& problem);
ReedsShepp (const ProblemConstPtr_t& problem,
......@@ -58,6 +63,7 @@ namespace hpp {
private:
WeighedDistancePtr_t weighedDistance_;
DeviceWkPtr_t device_;
/// Turning radius
value_type rho_;
JointPtr_t xy_, rz_;
size_type xyId_, rzId_;
......
......@@ -48,6 +48,10 @@ namespace hpp {
wheels_ = wheels;
}
void turningRadius(const value_type& rho);
inline value_type turningRadius() const { return rho_; }
protected:
/// Constructor
CarLike (const ProblemConstPtr_t& problem);
......@@ -69,6 +73,7 @@ namespace hpp {
}
DeviceWkPtr_t device_;
/// Turning radius
value_type rho_;
JointPtr_t xy_, rz_;
size_type xyId_, rzId_;
......
......@@ -72,8 +72,8 @@ namespace hpp {
xy_ = d->getJointAtConfigRank(xyId_);
rz_ = d->getJointAtConfigRank(rzId_);
wheels_ = steeringMethod::getWheelsFromeParameter(problem, rz_);
rho_ = problem->getParameter("SteeringMethod/Carlike/turningRadius").
floatValue();
turningRadius(problem->getParameter("SteeringMethod/Carlike/turningRadius").
floatValue());
}
ReedsShepp::ReedsShepp (const ProblemConstPtr_t& problem,
......@@ -102,6 +102,13 @@ namespace hpp {
{
}
void ReedsShepp::turningRadius(const value_type& rho)
{
if (rho <= 0)
throw std::invalid_argument("Turning radius must be strictly positive.");
rho_ = rho;
}
value_type ReedsShepp::impl_distance (ConfigurationIn_t q1,
ConfigurationIn_t q2) const
{
......
......@@ -38,8 +38,8 @@ namespace hpp {
xy_ = d->getJointAtConfigRank(0);
rz_ = d->getJointAtConfigRank(2);
wheels_ = getWheelsFromeParameter(problem, rz_);
rho_ = problem->getParameter("SteeringMethod/Carlike/turningRadius").
floatValue();
turningRadius(problem->getParameter("SteeringMethod/Carlike/turningRadius").
floatValue());
}
CarLike::CarLike (const ProblemConstPtr_t& problem,
......@@ -65,6 +65,13 @@ namespace hpp {
{
}
void CarLike::turningRadius(const value_type& rho)
{
if (rho <= 0)
throw std::invalid_argument("Turning radius must be strictly positive.");
rho_ = rho;
}
std::vector <JointPtr_t> getWheelsFromeParameter
(const ProblemConstPtr_t& problem, const JointPtr_t& rz)
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment