Skip to content

Commit

Permalink
fix: Clean up VD Project
Browse files Browse the repository at this point in the history
Remove unused `app.h` file. Update CMake structure since build system changed since this branch started. Rename some files from `.h` to `.hpp`
  • Loading branch information
BlakeFreer committed Jan 6, 2025
1 parent 7a9b38f commit b5e83cc
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 265 deletions.
10 changes: 1 addition & 9 deletions firmware/projects/VD_Interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,7 @@

# include("${CMAKE_SOURCE_DIR}/cmake/cangen.cmake")

target_sources(main PRIVATE main.cc)

target_include_directories(main
PRIVATE
${CMAKE_CURRENT_SOURCE_DIR}/inc
${CMAKE_CURRENT_SOURCE_DIR}/generated/can
)

message("SOURCES: ${SOURCES}")
target_sources(main PRIVATE main.cc)

# Notice that we don't include any mcal/ subdirectory in this CMake file.
# The master CMakeLists handles platform selection and library linking.
8 changes: 0 additions & 8 deletions firmware/projects/VD_Interface/config.yaml

This file was deleted.

237 changes: 0 additions & 237 deletions firmware/projects/VD_Interface/inc/app.h

This file was deleted.

2 changes: 1 addition & 1 deletion firmware/projects/VD_Interface/inc/simp_vd_interface.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// @author Teghveer Singh Ateliey
/// @date 2024-11-23

#include "simp_vd_interface.h"
#include "simp_vd_interface.hpp"

using namespace ctrl;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

#pragma once

#include "app.h"
#include <cstdint>

#include "shared/controls/motor_torque.h"
#include "shared/controls/tc_scale_factor.h"
#include "shared/controls/tvFactor.h"
#include "shared/util/mappers/lookup_table.h"
#include "shared/util/mappers/lookup_table.hpp"

struct VdInput {
float driver_torque_request;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/// @author Teghveer Singh Ateliey
/// @date 2024-11-23

#include "simp_vd_interface.h"
#include "simp_vd_interface.hpp"

#include <cassert>
#include <iostream>
Expand Down
2 changes: 1 addition & 1 deletion firmware/projects/VD_Interface/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/// @date 2025-01-04

#include "inc/simp_vd_interface_test.cc"
#include "inc/simp_vd_interface.h"
#include "inc/simp_vd_interface.hpp"
#include "inc/simp_vd_interface.cc"

int main(void) {
Expand Down
4 changes: 2 additions & 2 deletions firmware/projects/VD_Interface/platforms/cli/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
target_sources(bindings PRIVATE bindings.cc)
target_link_libraries(bindings PRIVATE mcal-cli)
target_sources(main PRIVATE bindings.cc)
target_link_libraries(main PRIVATE mcal-cli)
2 changes: 1 addition & 1 deletion firmware/shared/controls/motor_torque.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#pragma once
#include <tuple>

#include "shared/util/moving_average.h"
#include "shared/util/moving_average.hpp"

// Peter Jabra and Aleeza Ali Zar
namespace ctrl {
Expand Down
7 changes: 4 additions & 3 deletions firmware/shared/controls/tvFactor.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
#pragma once
#include <algorithm>
#include <tuple>
#include "../util/mappers/lookup_table.h"

namespace ctrl{
#include "shared/util/mappers/lookup_table.hpp"

namespace ctrl {

template <typename T>
T CreateTorqueVectoringFactor(T steering_angle) {
Expand Down Expand Up @@ -41,4 +42,4 @@ std::tuple<T, T> AdjustTorqueVectoring(T steering_angle,

return std::tuple(left_torque_vector, right_torque_vector);
}
}
} // namespace ctrl

0 comments on commit b5e83cc

Please sign in to comment.