Skip to content

Commit c13177a

Browse files
committed
Update foot-trajectory.hpp
1 parent d3bb9cf commit c13177a

File tree

2 files changed

+9
-15
lines changed

2 files changed

+9
-15
lines changed

include/simple-mpc/foot-trajectory.hpp

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
// All rights reserved.
77
///////////////////////////////////////////////////////////////////////////////
88

9-
#ifndef SIMPLE_MPC_FOOTTRAJ_HPP_
10-
#define SIMPLE_MPC_FOOTTRAJ_HPP_
9+
#pragma once
1110

1211
#include "simple-mpc/fwd.hpp"
1312
#include <ndcurves/fwd.h>
@@ -19,14 +18,11 @@ namespace simple_mpc
1918
* @brief Foot trajectory generation
2019
*/
2120

22-
typedef Eigen::Vector3d point3_t;
23-
typedef ndcurves::bezier_curve<float, double, false, point3_t> curve_translation;
24-
typedef ndcurves::piecewise_curve<float, double, false, point3_t> piecewise_curve;
21+
using point3_t = Eigen::Vector3d;
22+
using piecewise_curve = ndcurves::piecewise_curve<float, double, false, point3_t>;
2523

2624
class FootTrajectory
2725
{
28-
/**
29-
*/
3026
protected:
3127
std::map<std::string, point3_t> initial_poses_;
3228
std::map<std::string, point3_t> final_poses_;
@@ -38,18 +34,21 @@ namespace simple_mpc
3834
size_t T_;
3935

4036
public:
41-
FootTrajectory() {};
42-
virtual ~FootTrajectory() {};
37+
explicit FootTrajectory() {};
4338
FootTrajectory(
4439
const std::map<std::string, point3_t> & initial_poses, double swing_apex, int T_fly, int T_contact, size_t T);
40+
virtual ~FootTrajectory() {};
4541

4642
void updateApex(double swing_apex)
4743
{
4844
swing_apex_ = swing_apex;
4945
}
46+
5047
piecewise_curve defineTranslationBezier(const point3_t & trans_init, const point3_t & trans_final);
48+
5149
std::vector<point3_t> createTrajectory(
5250
int time_to_land, point3_t & initial_trans, point3_t & final_trans, piecewise_curve trajectory_swing);
51+
5352
void updateTrajectory(
5453
bool update,
5554
int landing_time,
@@ -63,9 +62,3 @@ namespace simple_mpc
6362
};
6463

6564
} // namespace simple_mpc
66-
67-
/* --- Details -------------------------------------------------------------- */
68-
/* --- Details -------------------------------------------------------------- */
69-
/* --- Details -------------------------------------------------------------- */
70-
71-
#endif // SIMPLE_MPC_HPP_

src/foot-trajectory.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515

1616
namespace simple_mpc
1717
{
18+
using curve_translation = ndcurves::bezier_curve<float, double, false, point3_t>;
1819

1920
FootTrajectory::FootTrajectory(
2021
const std::map<std::string, point3_t> & initial_poses, double swing_apex, int T_fly, int T_contact, size_t T)

0 commit comments

Comments
 (0)