Skip to content

Commit f8c7c53

Browse files
author
Shuo
committed
add kf submodule
1 parent d482d34 commit f8c7c53

File tree

6 files changed

+52
-12
lines changed

6 files changed

+52
-12
lines changed

Diff for: .devcontainer/Dockerfile

+26
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,32 @@ ENV TZ=America/New_York
4747
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
4848

4949

50+
# casadi
51+
52+
ENV SUPPORT_WS=/root/support_files
53+
WORKDIR $SUPPORT_WS
54+
RUN git clone https://github.com/casadi/casadi.git
55+
RUN cd ${SUPPORT_WS}/casadi && git checkout tags/3.5.5
56+
RUN mkdir ${SUPPORT_WS}/casadi/build && cd ${SUPPORT_WS}/casadi/build
57+
RUN cmake -DWITH_CPLEX=OFF -DWITH_KNITRO=OFF -DWITH_OOQP=OFF -DWITH_SNOPT=OFF ${SUPPORT_WS}/casadi
58+
RUN make -j8
59+
RUN make install
60+
# /usr/local/lib/casadi/
61+
# /usr/local/include/casadi
62+
63+
# filter for
64+
WORKDIR $SUPPORT_WS
65+
RUN git clone https://github.com/ShuoYangRobotics/gram_savitzky_golay.git
66+
WORKDIR ${SUPPORT_WS}/gram_savitzky_golay
67+
RUN git submodule init
68+
RUN git submodule update
69+
RUN mkdir build
70+
WORKDIR ${SUPPORT_WS}/gram_savitzky_golay/build
71+
RUN cmake -DCMAKE_BUILD_TYPE=Release ../
72+
RUN make
73+
RUN make install
74+
75+
5076
### run docker as a ssh daemon
5177
RUN apt-get update \
5278
&& apt-get install -y ssh

Diff for: CMakeLists.txt

+15-1
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ include_directories(
3535
${catkin_INCLUDE_DIRS}
3636
${EIGEN3_INCLUDE_DIR}
3737
)
38+
# search for casadi in the environment
39+
find_package(casadi REQUIRED)
40+
41+
# Find the savitzky golay filter package and all its dependencies
42+
find_package(gram_savitzky_golay REQUIRED)
3843

3944
catkin_package()
4045

@@ -63,10 +68,19 @@ add_library(vilo_lib
6368
src/factor/imu_leg_factor.cpp src/factor/imu_leg_factor.h src/factor/imu_leg_integration_base.cpp src/factor/imu_leg_integration_base.h
6469
)
6570

71+
72+
# kf subdirectory
73+
add_subdirectory(src/kalmanFilter)
74+
6675
target_link_libraries(vilo_lib ${catkin_LIBRARIES} ${OpenCV_LIBS} ${CERES_LIBRARIES})
6776

6877
add_executable(vilo src/main.cpp )
69-
target_link_libraries(vilo vilo_lib)
78+
target_link_libraries(vilo
79+
vilo_lib
80+
kf_lib
81+
casadi
82+
gram_savitzky_golay::gram_savitzky_golay
83+
)
7084

7185

7286
add_executable(ceres_test src/test/ceres_test.cpp src/legKinematics/A1Kinematics.cpp)

Diff for: src/estimator/estimator.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ void Estimator::setParameter()
152152
leg_offset_y[0] = 0.047; leg_offset_y[1] = -0.047; leg_offset_y[2] = 0.047; leg_offset_y[3] = -0.047;
153153
motor_offset[0] = 0.0838; motor_offset[1] = -0.0838; motor_offset[2] = 0.0838; motor_offset[3] = -0.0838;
154154
upper_leg_length[0] = upper_leg_length[1] = upper_leg_length[2] = upper_leg_length[3] = 0.21;
155-
lower_leg_length[0] = lower_leg_length[1] = lower_leg_length[2] = lower_leg_length[3] = LOWER_LEG_LENGTH;
155+
lower_leg_length[0] = lower_leg_length[1] = lower_leg_length[2] = lower_leg_length[3] = VINS_LOWER_LEG_LENGTH;
156156

157157
for (int i = 0; i < NUM_OF_LEG; i++) {
158158
Eigen::VectorXd rho_fix(RHO_FIX_SIZE); rho_fix << leg_offset_x[i],leg_offset_y[i],motor_offset[i],upper_leg_length[i];
@@ -161,10 +161,10 @@ void Estimator::setParameter()
161161

162162
for (int i = 0; i < WINDOW_SIZE + 1; i++)
163163
{
164-
Rho1[i] = LOWER_LEG_LENGTH*Eigen::Matrix<double, RHO_OPT_SIZE, 1>::Ones();
165-
Rho2[i] = LOWER_LEG_LENGTH*Eigen::Matrix<double, RHO_OPT_SIZE, 1>::Ones();
166-
Rho3[i] = LOWER_LEG_LENGTH*Eigen::Matrix<double, RHO_OPT_SIZE, 1>::Ones();
167-
Rho4[i] = LOWER_LEG_LENGTH*Eigen::Matrix<double, RHO_OPT_SIZE, 1>::Ones();
164+
Rho1[i] = VINS_LOWER_LEG_LENGTH*Eigen::Matrix<double, RHO_OPT_SIZE, 1>::Ones();
165+
Rho2[i] = VINS_LOWER_LEG_LENGTH*Eigen::Matrix<double, RHO_OPT_SIZE, 1>::Ones();
166+
Rho3[i] = VINS_LOWER_LEG_LENGTH*Eigen::Matrix<double, RHO_OPT_SIZE, 1>::Ones();
167+
Rho4[i] = VINS_LOWER_LEG_LENGTH*Eigen::Matrix<double, RHO_OPT_SIZE, 1>::Ones();
168168
}
169169

170170
mProcess.unlock();

Diff for: src/utils/parameters.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ double V_N_TERM2_VAR_RESCALE;
6464
double V_N_TERM3_DISTANCE_RESCALE;
6565
double V_N_FINAL_RATIO;
6666

67-
double LOWER_LEG_LENGTH;
67+
double VINS_LOWER_LEG_LENGTH;
6868

6969
int MAX_CNT;
7070
int MIN_DIST;
@@ -157,7 +157,7 @@ void readParameters(std::string config_file)
157157
V_N_TERM3_DISTANCE_RESCALE = fsSettings["v_n_term3_distance_rescale"];
158158
V_N_FINAL_RATIO = fsSettings["v_n_final_ratio"];
159159

160-
LOWER_LEG_LENGTH = fsSettings["lower_leg_length"];
160+
VINS_LOWER_LEG_LENGTH = fsSettings["lower_leg_length"];
161161
}
162162

163163
SOLVER_TIME = fsSettings["max_solver_time"];
@@ -167,9 +167,9 @@ void readParameters(std::string config_file)
167167

168168
fsSettings["output_path"] >> OUTPUT_FOLDER;
169169
if (OPTIMIZE_LEG_BIAS) {
170-
VINS_RESULT_PATH = OUTPUT_FOLDER + "/vilo_wb"+ Utility::GetCurrentTimeForFileName() + "-lc-" + to_string(LOWER_LEG_LENGTH) + ".csv";
170+
VINS_RESULT_PATH = OUTPUT_FOLDER + "/vilo_wb"+ Utility::GetCurrentTimeForFileName() + "-lc-" + to_string(VINS_LOWER_LEG_LENGTH) + ".csv";
171171
} else {
172-
VINS_RESULT_PATH = OUTPUT_FOLDER + "/vilo_wob"+ Utility::GetCurrentTimeForFileName() + "-lc-" + to_string(LOWER_LEG_LENGTH) + ".csv";
172+
VINS_RESULT_PATH = OUTPUT_FOLDER + "/vilo_wob"+ Utility::GetCurrentTimeForFileName() + "-lc-" + to_string(VINS_LOWER_LEG_LENGTH) + ".csv";
173173
}
174174
std::cout << "result path " << VINS_RESULT_PATH << std::endl;
175175
std::ofstream fout(VINS_RESULT_PATH, std::ios::out);

Diff for: src/utils/parameters.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ extern double V_N_TERM2_VAR_RESCALE;
7373
extern double V_N_TERM3_DISTANCE_RESCALE;
7474
extern double V_N_FINAL_RATIO;
7575

76-
extern double LOWER_LEG_LENGTH;
76+
extern double VINS_LOWER_LEG_LENGTH;
7777

7878
extern int MULTIPLE_THREAD;
7979
// pts_gt for debug purpose;

0 commit comments

Comments
 (0)