Skip to content

Commit c31ae9f

Browse files
committed
Fix pre-commit check errors
1 parent 82803cc commit c31ae9f

File tree

4 files changed

+14
-7
lines changed

4 files changed

+14
-7
lines changed

simulator/learned_model/include/learned_model/interconnected_model.hpp

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@
2424
#include <pybind11/stl.h>
2525

2626
#include <algorithm>
27+
#include <memory>
28+
#include <string>
29+
#include <tuple>
30+
#include <vector>
2731

2832
namespace py = pybind11;
2933

simulator/learned_model/include/learned_model/simple_pymodel.hpp

+3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@
2121
#include <pybind11/embed.h>
2222
#include <pybind11/stl.h>
2323

24+
#include <string>
25+
#include <vector>
26+
2427
namespace py = pybind11;
2528

2629
/**

simulator/learned_model/src/simple_pymodel.cpp

-3
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,13 @@ SimplePymodel::SimplePymodel(
3232
// Initialize model class from imported module
3333
py_model_class = imported_module.attr(py_class_name.c_str())();
3434
} else {
35-
// TODO throw exception/error
3635
return;
3736
}
3837

3938
// Load model parameters and reset the model
4039
if (!param_file_path.empty()) {
4140
py::object load_params_succ = py_model_class.attr("load_params")(param_file_path.c_str());
4241
py_model_class.attr("reset")();
43-
} else {
44-
// TODO warning that using default model params
4542
}
4643

4744
// Get string names of states of python model, convert them to C++ string and store them in

simulator/simple_planning_simulator/include/simple_planning_simulator/vehicle_model/sim_model_learned_steer_vel.hpp

+7-4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include <deque>
2525
#include <iostream>
2626
#include <queue>
27+
#include <string>
28+
#include <vector>
2729

2830
/**
2931
* @class SimModelLearnedSteerVel
@@ -51,11 +53,12 @@ class SimModelLearnedSteerVel : public SimModelInterface /*delay steer velocity*
5153
inputs of this model to states and inputs of the python model.
5254
*/
5355

54-
std::vector<char *> state_names = {(char *)"POS_X", (char *)"POS_Y", (char *)"YAW",
55-
(char *)"YAW_RATE", (char *)"VX", (char *)"VY",
56-
(char *)"STEER"};
56+
std::vector<char *> state_names = {const_cast<char *>("POS_X"), const_cast<char *>("POS_Y"),
57+
const_cast<char *>("YAW"), const_cast<char *>("YAW_RATE"),
58+
const_cast<char *>("VX"), const_cast<char *>("VY"),
59+
const_cast<char *>("STEER")};
5760

58-
std::vector<char *> input_names = {(char *)"VX_DES", (char *)"STEER_DES"};
61+
std::vector<char *> input_names = {const_cast<char *>("VX_DES"), const_cast<char *>("STEER_DES")};
5962

6063
enum IDX {
6164
X = 0,

0 commit comments

Comments
 (0)