Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/integrate simulink automation #21

Merged
merged 64 commits into from
Nov 14, 2024
Merged
Show file tree
Hide file tree
Changes from 62 commits
Commits
Show all changes
64 commits
Select commit Hold shift + click to select a range
20fa99a
Added basic unit test, linking with CI
KrishKittur Oct 5, 2024
221ba03
Added CI integration
KrishKittur Oct 5, 2024
6ee02a4
fix?
KrishKittur Oct 5, 2024
f1a7471
remove opening dev environment
KrishKittur Oct 5, 2024
83ca92b
remove opening dev environment
KrishKittur Oct 5, 2024
3c5b8d9
Actually run tests
KrishKittur Oct 5, 2024
4a88fd6
check versioning
KrishKittur Oct 5, 2024
b4377ae
Updated cachix to use latest version
KrishKittur Oct 5, 2024
679c6ce
using same nix version as I am locally now
KrishKittur Oct 5, 2024
385901d
Generate makefile
KrishKittur Oct 5, 2024
5009bdf
fix
KrishKittur Oct 5, 2024
35c19ec
plz fix
KrishKittur Oct 5, 2024
a8f54e3
fix commands maybe
KrishKittur Oct 5, 2024
8151a63
work?
KrishKittur Oct 5, 2024
81edf9f
Change
KrishKittur Oct 5, 2024
c9a9907
Change
KrishKittur Oct 5, 2024
37b6d83
build and develop in same run block
KrishKittur Oct 5, 2024
a6289f1
Add missing dependencies
KrishKittur Oct 5, 2024
6e3d531
just build
KrishKittur Oct 5, 2024
518a8ac
Add test
KrishKittur Oct 5, 2024
6d75523
Use default devshell
KrishKittur Oct 5, 2024
0f40da5
See if this errors out
KrishKittur Oct 6, 2024
277307e
Was accidentally pointing to wrong repo instead of HT_proto
KrishKittur Oct 6, 2024
65b2363
work?
KrishKittur Oct 6, 2024
56f33f3
Make shell valid
KrishKittur Oct 6, 2024
c090859
combine everything
KrishKittur Oct 6, 2024
db02e9c
change
KrishKittur Oct 6, 2024
510a908
add ls
KrishKittur Oct 6, 2024
c88d024
Change results to result
KrishKittur Oct 7, 2024
a9a6d45
Show metadata to help with debugging
KrishKittur Oct 7, 2024
f4a7421
added flake metadata output plus trying to generate makefile
KrishKittur Oct 7, 2024
bb5e2f0
Added a test fixture class for SimpleController and make sure that rp…
KrishKittur Oct 8, 2024
9f128fd
Test develop and build in CI
KrishKittur Oct 22, 2024
0173658
Try printing out nix store
KrishKittur Oct 22, 2024
d30be00
Fix yml syntax
KrishKittur Oct 22, 2024
82758d3
akldsfljkasd
KrishKittur Oct 22, 2024
e53554e
Echo prefix path
KrishKittur Oct 22, 2024
c372f9c
Add prints to make prefix path more clear
KrishKittur Oct 22, 2024
f4950e5
Sketchy github runner fix go brr
KrishKittur Oct 22, 2024
94c9cbb
Add tests and make it so that all the commands are actually running i…
KrishKittur Oct 22, 2024
34dd23f
Seperate steps in github workflow
KrishKittur Oct 22, 2024
6578355
Add doxygen and doxygen workflow
KrishKittur Oct 22, 2024
ebeaf90
Combine build and test
KrishKittur Oct 22, 2024
5c972c7
Don't enter dev environment twice
KrishKittur Oct 22, 2024
14149c8
Fix output directory in doxyfile
KrishKittur Oct 22, 2024
4ed93dc
Change output dir again
KrishKittur Oct 22, 2024
c32374f
Change output directory so that files aren't in an html folder
KrishKittur Oct 22, 2024
dcb564b
Change INPUT tag to point to all drivebrain folders
KrishKittur Oct 22, 2024
d388480
Use README as main page
KrishKittur Oct 22, 2024
1966dc8
Change to only run github actions on pushes to master
KrishKittur Oct 22, 2024
4b9326a
Fix bad syntax in yml files
KrishKittur Oct 22, 2024
dec0f30
Run unit tests on push to any branch
KrishKittur Oct 22, 2024
01913d3
Integrate relevant changes
KrishKittur Oct 22, 2024
38fdfed
Fix shell hook
KrishKittur Oct 22, 2024
7271352
Make speed set a live param again
KrishKittur Oct 22, 2024
70c3e0f
Add live param speed set back
KrishKittur Oct 22, 2024
2a45df3
Complete merge
KrishKittur Oct 23, 2024
736df7d
Added support for code generated by simulink_automation
KrishKittur Oct 27, 2024
5d5983c
drivebrain connected to simulink automation
KrishKittur Nov 11, 2024
613ca26
unpack vehicle data and raw inputs
KrishKittur Nov 13, 2024
2195db3
works now:
KrishKittur Nov 13, 2024
49101e1
builds
KrishKittur Nov 14, 2024
575ee78
Added z moments to output
KrishKittur Nov 14, 2024
2bd8fdb
set log level to warn
RCMast3r Nov 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 16 additions & 40 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ find_package(fmt REQUIRED)
find_package(spdlog REQUIRED)



### generated via nix-proto from hytech's generated CAN protobufs
find_package(hytech_np_proto_cpp CONFIG REQUIRED)
find_package(drivebrain_core_msgs_proto_cpp CONFIG REQUIRED)
Expand Down Expand Up @@ -41,45 +42,17 @@ find_package(cmake_macros REQUIRED)
find_package(GTest REQUIRED)
find_package(gRPC CONFIG REQUIRED)
find_package(db_service_grpc_cpp REQUIRED)
find_package(matlab_math REQUIRED)
find_package(codegen REQUIRED)

find_package(drivebrain_core REQUIRED)

include(create_package)

#####################
# created libraries #
#####################

# drivebrain core library
add_library(drivebrain_core SHARED
drivebrain_core_base/src/JsonFileHandler.cpp
drivebrain_core_base/src/Configurable.cpp
drivebrain_core_base/src/Logger.cpp)

target_include_directories(drivebrain_core PUBLIC
$<INSTALL_INTERFACE:drivebrain_core_base/include/public>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/drivebrain_core_base/include/public>
)

# right now we dont want to expose the json file handler directly to all of the
# components of drivebrain

target_include_directories(drivebrain_core PRIVATE
$<INSTALL_INTERFACE:drivebrain_core_base/include/private>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/drivebrain_core_base/include/private>
)

target_link_libraries(drivebrain_core PUBLIC
nlohmann_json::nlohmann_json
Boost::boost
Boost::system
drivebrain_core_msgs_proto_cpp::drivebrain_core_msgs_proto_cpp
hytech_np_proto_cpp::hytech_np_proto_cpp
spdlog::spdlog
)

make_cmake_package(drivebrain_core drivebrain)


# utils
add_library(drivebrain_common_utils SHARED
drivebrain_core_impl/drivebrain_common_utils/src/ProtobufUtils.cpp
)
Expand Down Expand Up @@ -119,7 +92,7 @@ target_include_directories(drivebrain_comms PUBLIC
)

target_link_libraries(drivebrain_comms PUBLIC
drivebrain_core
drivebrain_core::drivebrain_core
drivebrain_common_utils
gRPC::grpc++_reflection
foxglove_websocket::foxglove_websocket
Expand All @@ -144,7 +117,7 @@ target_include_directories(drivebrain_control PUBLIC
)

target_link_libraries(drivebrain_control PUBLIC
drivebrain_core
drivebrain_core::drivebrain_core
hytech_np_proto_cpp::hytech_np_proto_cpp
protobuf::libprotobuf
)
Expand All @@ -158,7 +131,7 @@ target_include_directories(drivebrain_mcap_logger PUBLIC
)

target_link_libraries(drivebrain_mcap_logger PUBLIC
drivebrain_core
drivebrain_core::drivebrain_core
drivebrain_common_utils
protobuf::libprotobuf
mcap::mcap
Expand All @@ -171,7 +144,6 @@ target_include_directories(drivebrain_mcap_logger PUBLIC
make_cmake_package(drivebrain_mcap_logger drivebrain)

add_library(drivebrain_estimation SHARED
drivebrain_core_impl/drivebrain_estimation/src/MatlabMath.cpp
drivebrain_core_impl/drivebrain_estimation/src/StateEstimator.cpp
)

Expand All @@ -181,9 +153,13 @@ target_include_directories(drivebrain_estimation PUBLIC
)

target_link_libraries(drivebrain_estimation PUBLIC
drivebrain_core
drivebrain_core::drivebrain_core
drivebrain_common_utils
matlab_math::matlab_math_lib
codegen::Tire_Model_Codegen
codegen::matlab_model
hytech_np_proto_cpp::hytech_np_proto_cpp
drivebrain_core_msgs_proto_cpp::drivebrain_core_msgs_proto_cpp
protobuf::libprotobuf
)

make_cmake_package(drivebrain_estimation drivebrain)
Expand Down Expand Up @@ -261,7 +237,7 @@ add_executable(alpha_test
)

target_link_libraries(alpha_build PUBLIC
drivebrain_core
drivebrain_core::drivebrain_core
drivebrain_control
drivebrain_comms
drivebrain_mcap_logger
Expand All @@ -270,7 +246,7 @@ target_link_libraries(alpha_build PUBLIC


target_link_libraries(alpha_test PUBLIC
drivebrain_core
drivebrain_core::drivebrain_core
drivebrain_control
drivebrain_comms
Boost::program_options
Expand Down
68 changes: 34 additions & 34 deletions config/drivebrain_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,41 +16,41 @@
"port": 1,
"freq_divisor": 1
},
"MatlabMath":
"Tire_Model_Codegen_MatlabModel":
{
"lmux_fl": 1,
"lmuy_fl": 1,
"lmux_fr": 1,
"lmuy_fr": 1,
"lmux_rl": 1,
"lmuy_rl": 1,
"lmux_rr": 1,
"lmuy_rr": 1,
"x1_fl": 604,
"x2_fl": 1073,
"x3_fl": 1320,
"y1_fl": 385,
"y2_fl": 598,
"y3_fl": 718,
"x1_fr": 761,
"x2_fr": 1276,
"x3_fr": 1570,
"y1_fr": 440,
"y2_fr": 654,
"y3_fr": 684,
"x1_rl": 906,
"x2_rl": 1160,
"x3_rl": 1496,
"y1_rl": 517,
"y2_rl": 637,
"y3_rl": 819,
"x1_rr": 638,
"x2_rr": 855,
"x3_rr": 1165,
"y1_rr": 451,
"y2_rr": 565,
"y3_rr": 734,
"use_fake_data": false,
"LMUXFL": 1,
"LMUYFL": 1,
"LMUXFR": 1,
"LMUYFR": 1,
"LMUXRL": 1,
"LMUYRL": 1,
"LMUXRR": 1,
"LMUYRR": 1,
"Interp_x1_FL": 604,
"Interp_x2_FL": 1073,
"Interp_x3_FL": 1320,
"interp_y1_FL": 385,
"interp_y2_FL": 598,
"interp_y3_FL": 718,
"Interp_x1_FR": 761,
"Interp_x2_FR": 1276,
"Interp_x3_FR": 1570,
"interp_y1_FR": 440,
"interp_y2_FR": 654,
"interp_y3_FR": 684,
"Interp_x1_RL": 906,
"Interp_x2_RL": 1160,
"Interp_x3_RL": 1496,
"interp_y1_RL": 517,
"interp_y2_RL": 637,
"interp_y3_RL": 819,
"Interp_x1_RR": 638,
"Interp_x2_RR": 855,
"Interp_x3_RR": 1165,
"interp_y1_RR": 451,
"interp_y2_RR": 565,
"interp_y3_RR": 734,
"useFakeData": false,
"Fake_Vx": 3.0,
"DriveBiasFront": 1.0,
"BrakeBiasFront": 1.0,
Expand Down
7 changes: 7 additions & 0 deletions db-core.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{ pkgs, stdenv, cmake, boost, pkg-config, cmake_macros, protobuf, drivebrain_core_msgs_proto_cpp, hytech_np_proto_cpp, nlohmann_json, db-core-src, spdlog, fmt }:
stdenv.mkDerivation {
name = "db-core";
src = db-core-src;
nativeBuildInputs = [ cmake pkg-config cmake_macros ];
propagatedBuildInputs = [ boost protobuf drivebrain_core_msgs_proto_cpp hytech_np_proto_cpp nlohmann_json cmake_macros spdlog fmt ];
}
6 changes: 3 additions & 3 deletions default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{ pkgs, stdenv, cmake, boost, pkg-config, lz4 ,zstd, protobuf, nlohmann_json, foxglove-ws-protocol-cpp, cmake_macros, hytech_np_proto_cpp, dbcppp, gtest, drivebrain_core_msgs_proto_cpp, mcap, db_service_grpc_cpp, grpc, vn_lib, matlab_math, spdlog, fmt, ... }:
{ pkgs, stdenv, cmake, boost, pkg-config, lz4 ,zstd, protobuf, nlohmann_json, foxglove-ws-protocol-cpp, cmake_macros, hytech_np_proto_cpp, dbcppp, gtest, drivebrain_core_msgs_proto_cpp, mcap, db_service_grpc_cpp, grpc, vn_lib, drivebrain_core, simulink_automation, spdlog, fmt, ... }:

stdenv.mkDerivation {
name = "drivebrain_software";
src = ./.;
nativeBuildInputs = [ cmake pkg-config ];
propagatedBuildInputs = [ protobuf lz4 zstd boost cmake_macros nlohmann_json foxglove-ws-protocol-cpp hytech_np_proto_cpp dbcppp gtest drivebrain_core_msgs_proto_cpp mcap db_service_grpc_cpp grpc vn_lib matlab_math spdlog fmt];

propagatedBuildInputs = [ protobuf lz4 zstd boost cmake_macros nlohmann_json foxglove-ws-protocol-cpp hytech_np_proto_cpp dbcppp gtest drivebrain_core_msgs_proto_cpp mcap db_service_grpc_cpp grpc vn_lib drivebrain_core simulink_automation spdlog fmt ];
dontStrip = true;
cmakeFlags = [ "-DCMAKE_FIND_DEBUG_MODE=ON"];
}
2 changes: 1 addition & 1 deletion drivebrain_app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ int main(int argc, char *argv[])
control::SimpleController controller(logger, config);
configurable_components.push_back(&controller);
bool construction_failed = false;
estimation::MatlabMath matlab_math(logger, config, construction_failed);
estimation::Tire_Model_Codegen_MatlabModel matlab_math(logger, config, construction_failed);

if (construction_failed)
{
Expand Down
Loading