-
Notifications
You must be signed in to change notification settings - Fork 230
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
created new quintic swingleg_z_height polynomial
- Loading branch information
Alexander Winkler
committed
Apr 6, 2017
1 parent
20fe593
commit 16cc975
Showing
6 changed files
with
72 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
@file ee_height_z_polynomial.h | ||
@file ee_swing_motion.h | ||
@author Alexander W. Winkler ([email protected]) | ||
@date Jan 16, 2017 | ||
@brief Brief description | ||
|
@@ -23,7 +23,7 @@ namespace opt { | |
class EESwingMotion { | ||
public: | ||
using PolyXY = PolynomialXd<CubicPolynomial, StateLin2d>; | ||
using PolyZ = QuinticPolynomial; | ||
using PolyZ = LiftHeightPolynomial; | ||
|
||
EESwingMotion (); | ||
virtual ~EESwingMotion (); | ||
|
@@ -55,10 +55,7 @@ class EESwingMotion { | |
private: | ||
PolyZ poly_z_; | ||
PolyXY poly_xy_; | ||
|
||
double T_ = 0.0; ///< the duration [s] of the motion | ||
double h_ = 0.03; ///< proportional to the lift height between contacts | ||
int n_ = 6; ///< determines the shape of the swing motion | ||
}; | ||
|
||
} /* namespace opt */ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/** | ||
@file ee_height_z_polynomial.cc | ||
@file ee_swing_motion.cc | ||
@author Alexander W. Winkler ([email protected]) | ||
@date Jan 16, 2017 | ||
@brief Brief description | ||
|
@@ -23,7 +23,7 @@ EESwingMotion::Init (double T, double h, const Vector3d& start, | |
const Vector3d& end) | ||
{ | ||
T_ = T; | ||
h_ = h; | ||
poly_z_.SetShape(6,h); | ||
SetContacts(start, end); | ||
} | ||
|
||
|
@@ -34,32 +34,13 @@ EESwingMotion::GetDuration () const | |
} | ||
|
||
void | ||
EESwingMotion::SetContacts (const Vector3d& start_pos, const Vector3d& end_pos) | ||
EESwingMotion::SetContacts (const Vector3d& start_pos, | ||
const Vector3d& end_pos) | ||
{ | ||
StateLin3d start_state(start_pos); | ||
StateLin3d end_state(end_pos); | ||
poly_xy_.SetBoundary(T_, start_state.Get2D(), end_state.Get2D()); | ||
|
||
double n2 = std::pow(n_,2); | ||
double n3 = std::pow(n_,3); | ||
double n4 = std::pow(n_,4); | ||
double n5 = std::pow(n_,5); | ||
|
||
double t2 = std::pow(T_,2); | ||
double t3 = std::pow(T_,3); | ||
double t4 = std::pow(T_,4); | ||
double t5 = std::pow(T_,5); | ||
|
||
double z_start = start_pos.z(); | ||
double z_end = end_pos.z(); | ||
// see matlab script "swingleg_z_height.m" for generation of these values | ||
poly_z_.c[Polynomial::A] = -(2*(2*n2*z_end - 3*n3*z_end - 2*n2*z_start + 3*n3*z_start))/(t5*(n_ - 2)*(n2 - 2*n_ + 1)); | ||
poly_z_.c[Polynomial::B] = -(2*h_*n4 - h_*n5 - 10*n2*z_end + 15*n3*z_end + 10*n2*z_start - 15*n3*z_start)/(t4*(n_ - 2)*(n2 - 2*n_ + 1)); | ||
poly_z_.c[Polynomial::C] = (2*(2*z_end - 2*z_start - 5*n_*z_end + 5*n_*z_start + 2*h_*n4 - h_*n5 + 5*n3*z_end - 5*n3*z_start))/((n_ - 2)*(n2*t3 - 2*n_*t3 + t3)); | ||
poly_z_.c[Polynomial::D] = (6*z_end - 6*z_start - 15*n_*z_end + 15*n_*z_start + 2*h_*n4 - h_*n5 + 10*n2*z_end - 10*n2*z_start)/(- n3*t2 + 4*n2*t2 - 5*n_*t2 + 2*t2); | ||
poly_z_.c[Polynomial::E] = 0; | ||
poly_z_.c[Polynomial::F] = z_start; | ||
poly_z_.duration = T_; | ||
poly_z_.SetBoundary(T_,start_state.Get1d(Z), end_state.Get1d(Z)); | ||
} | ||
|
||
StateLin3d | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters