Skip to content

Commit bd8f912

Browse files
authored
Merge pull request #276 from thowell/ilqs_fix
iLQS fix + planner tidy
2 parents fd36cb8 + 922247f commit bd8f912

File tree

5 files changed

+16
-15
lines changed

5 files changed

+16
-15
lines changed

mjpc/direct/direct.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef MJPC_DIRECT_OPTIMIZER_H_
16-
#define MJPC_DIRECT_OPTIMIZER_H_
15+
#ifndef MJPC_DIRECT_DIRECT_H_
16+
#define MJPC_DIRECT_DIRECT_H_
1717

1818
#include <memory>
1919
#include <string>
@@ -64,7 +64,7 @@ class Direct {
6464
: model_parameters_(LoadModelParameters()), pool_(num_threads) {}
6565

6666
// constructor
67-
Direct(const mjModel* model, int length = 3, int max_history = 0);
67+
explicit Direct(const mjModel* model, int length = 3, int max_history = 0);
6868

6969
// destructor
7070
virtual ~Direct() {
@@ -509,4 +509,4 @@ std::string StatusString(int code);
509509

510510
} // namespace mjpc
511511

512-
#endif // MJPC_DIRECT_OPTIMIZER_H_
512+
#endif // MJPC_DIRECT_DIRECT_H_

mjpc/planners/gradient/planner.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef MJPC_PLANNERS_GRADIENT_OPTIMIZER_H_
16-
#define MJPC_PLANNERS_GRADIENT_OPTIMIZER_H_
15+
#ifndef MJPC_PLANNERS_GRADIENT_PLANNER_H_
16+
#define MJPC_PLANNERS_GRADIENT_PLANNER_H_
1717

1818
#include <memory>
1919
#include <shared_mutex>
@@ -164,4 +164,4 @@ class GradientPlanner : public Planner {
164164

165165
} // namespace mjpc
166166

167-
#endif // MJPC_PLANNERS_GRADIENT_OPTIMIZER_H_
167+
#endif // MJPC_PLANNERS_GRADIENT_PLANNER_H_

mjpc/planners/ilqg/planner.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef MJPC_PLANNERS_ILQG_OPTIMIZER_H_
16-
#define MJPC_PLANNERS_ILQG_OPTIMIZER_H_
15+
#ifndef MJPC_PLANNERS_ILQG_PLANNER_H_
16+
#define MJPC_PLANNERS_ILQG_PLANNER_H_
1717

1818
#include <shared_mutex>
1919
#include <vector>
@@ -161,4 +161,4 @@ class iLQGPlanner : public Planner {
161161

162162
} // namespace mjpc
163163

164-
#endif // MJPC_PLANNERS_ILQG_OPTIMIZER_H_
164+
#endif // MJPC_PLANNERS_ILQG_PLANNER_H_

mjpc/planners/ilqs/planner.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ void iLQSPlanner::OptimizePolicy(int horizon, ThreadPool& pool) {
114114
if (dim_actions != sampling.model->nu * (horizon - 1) ||
115115
dim_parameters != sampling.model->nu * num_spline_points) {
116116
// dimension
117-
int dim_parameters = sampling.model->nu * num_spline_points;
118-
int dim_actions = sampling.model->nu * (horizon - 1);
117+
dim_parameters = sampling.model->nu * num_spline_points;
118+
dim_actions = sampling.model->nu * (horizon - 1);
119119

120120
// compute parameter to action mapping
121121
mappings[sampling.policy.representation]->Compute(

mjpc/planners/ilqs/planner.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@
1212
// See the License for the specific language governing permissions and
1313
// limitations under the License.
1414

15-
#ifndef MJPC_PLANNERS_ILQS_OPTIMIZER_H_
16-
#define MJPC_PLANNERS_ILQS_OPTIMIZER_H_
15+
#ifndef MJPC_PLANNERS_ILQS_PLANNER_H_
16+
#define MJPC_PLANNERS_ILQS_PLANNER_H_
1717

1818
#include <mujoco/mujoco.h>
1919

20+
#include <memory>
2021
#include <shared_mutex>
2122
#include <vector>
2223

@@ -110,4 +111,4 @@ class iLQSPlanner : public Planner {
110111

111112
} // namespace mjpc
112113

113-
#endif // MJPC_PLANNERS_ILQS_OPTIMIZER_H_
114+
#endif // MJPC_PLANNERS_ILQS_PLANNER_H_

0 commit comments

Comments
 (0)