Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
Signed-off-by: kosuke55 <kosuke.tnp@gmail.com>
  • Loading branch information
kosuke55 committed Jun 25, 2022
1 parent df0f799 commit 657beb8
Show file tree
Hide file tree
Showing 9 changed files with 1 addition and 2,309 deletions.
12 changes: 0 additions & 12 deletions control/trajectory_follower/src/mpc_lateral_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,6 @@ MpcLateralController::MpcLateralController(rclcpp::Node & node) : node_{&node}
m_mpc.initializeLowPassFilters(steering_lpf_cutoff_hz, error_deriv_lpf_cutoff_hz);
}

/* set up ros system */
// initTimer(m_mpc.m_ctrl_period);

m_pub_ctrl_cmd =
node_->create_publisher<autoware_auto_control_msgs::msg::AckermannLateralCommand>(
"~/output/lateral_control_cmd", 1);
Expand Down Expand Up @@ -368,7 +365,6 @@ autoware_auto_control_msgs::msg::AckermannLateralCommand MpcLateralController::c
autoware_auto_control_msgs::msg::AckermannLateralCommand ctrl_cmd)
{
ctrl_cmd.stamp = node_->now();
// m_pub_ctrl_cmd->publish(ctrl_cmd);
m_steer_cmd_prev = ctrl_cmd.steering_tire_angle;
return ctrl_cmd;
}
Expand All @@ -389,14 +385,6 @@ void MpcLateralController::publishDiagnostic(
m_pub_diagnostic->publish(diagnostic);
}

// void MpcLateralController::initTimer(float64_t period_s)
// {
// const auto period_ns = std::chrono::duration_cast<std::chrono::nanoseconds>(
// std::chrono::duration<float64_t>(period_s));
// m_timer = rclcpp::create_timer(
// this, node_->get_clock(), period_ns, std::bind(&MpcLateralController::onTimer, this));
// }

void MpcLateralController::declareMPCparameters()
{
m_mpc.m_param.prediction_horizon = node_->declare_parameter<int64_t>("mpc_prediction_horizon");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,9 @@

#include "motion_common/motion_common.hpp"
#include "motion_common/trajectory_common.hpp"
#include "tier4_autoware_utils/tier4_autoware_utils.hpp"
#include "time_utils/time_utils.hpp"

#include <tier4_autoware_utils/tier4_autoware_utils.hpp>

#include <algorithm>
#include <limits>
#include <memory>
Expand Down Expand Up @@ -665,7 +664,6 @@ autoware_auto_control_msgs::msg::LongitudinalCommand PidLongitudinalController::
cmd.stamp = node_->now();
cmd.speed = static_cast<decltype(cmd.speed)>(ctrl_cmd.vel);
cmd.acceleration = static_cast<decltype(cmd.acceleration)>(ctrl_cmd.acc);
// m_pub_control_cmd->publish(cmd);

// store current velocity history
m_vel_hist.push_back({node_->now(), current_vel});
Expand Down
56 changes: 0 additions & 56 deletions control/trajectory_follower_nodes/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,48 +4,6 @@ project(trajectory_follower_nodes)
find_package(autoware_cmake REQUIRED)
autoware_package()

set(LATERAL_CONTROLLER_NODE lateral_controller_node)
ament_auto_add_library(${LATERAL_CONTROLLER_NODE} SHARED
include/trajectory_follower_nodes/lateral_controller_node.hpp
src/lateral_controller_node.cpp
)

# TODO(lateral_controller) : RCLCPP_ERROR_THROTTLE() has built-in old-style casts.
# TODO(lateral_controller) : Temporary workaround until this is fixed.
target_compile_options(${LATERAL_CONTROLLER_NODE} PRIVATE -Wno-error=old-style-cast)
rclcpp_components_register_node(${LATERAL_CONTROLLER_NODE}
PLUGIN "autoware::motion::control::trajectory_follower_nodes::LateralController"
EXECUTABLE ${LATERAL_CONTROLLER_NODE}_exe
)

set(LONGITUDINAL_CONTROLLER_NODE longitudinal_controller_node)
ament_auto_add_library(${LONGITUDINAL_CONTROLLER_NODE} SHARED
include/trajectory_follower_nodes/longitudinal_controller_node.hpp
src/longitudinal_controller_node.cpp
)

# TODO(longitudinal_controller) : RCLCPP_ERROR_THROTTLE() has built-in old-style casts.
# TODO(longitudinal_controller) : Temporary workaround until this is fixed.
target_compile_options(${LONGITUDINAL_CONTROLLER_NODE} PRIVATE -Wno-error=old-style-cast)
rclcpp_components_register_node(${LONGITUDINAL_CONTROLLER_NODE}
PLUGIN "autoware::motion::control::trajectory_follower_nodes::LongitudinalController"
EXECUTABLE ${LONGITUDINAL_CONTROLLER_NODE}_exe
)

set(LATLON_MUXER_NODE latlon_muxer_node)
ament_auto_add_library(${LATLON_MUXER_NODE} SHARED
include/trajectory_follower_nodes/latlon_muxer_node.hpp
src/latlon_muxer_node.cpp
)

# TODO(latlon_muxer) : RCLCPP_ERROR_THROTTLE() has built-in old-style casts.
# TODO(latlon_muxer) : Temporary workaround until this is fixed.
target_compile_options(${LATLON_MUXER_NODE} PRIVATE -Wno-error=old-style-cast)
rclcpp_components_register_node(${LATLON_MUXER_NODE}
PLUGIN "autoware::motion::control::trajectory_follower_nodes::LatLonMuxer"
EXECUTABLE ${LATLON_MUXER_NODE}_exe
)

set(CONTROLLER_NODE controller_node)
ament_auto_add_library(${CONTROLLER_NODE} SHARED
include/trajectory_follower_nodes/controller_node.hpp
Expand All @@ -62,10 +20,7 @@ if(BUILD_TESTING)
set(TRAJECTORY_FOLLOWER_NODES_TEST test_trajectory_follower_nodes)
ament_add_ros_isolated_gtest(${TRAJECTORY_FOLLOWER_NODES_TEST}
test/trajectory_follower_test_utils.hpp
# test/test_latlon_muxer_node.cpp
test/test_controller_node.cpp
# test/test_lateral_controller_node.cpp
# test/test_longitudinal_controller_node.cpp
)
ament_target_dependencies(${TRAJECTORY_FOLLOWER_NODES_TEST} fake_test_node)
target_link_libraries(
Expand All @@ -75,17 +30,6 @@ if(BUILD_TESTING)
add_smoke_test(${PROJECT_NAME} ${CONTROLLER_NODE}_exe
PARAM_FILENAMES "lateral_controller_defaults.param.yaml longitudinal_controller_defaults.param.yaml test_vehicle_info.param.yaml"
)


# add_smoke_test(${PROJECT_NAME} ${LATLON_MUXER_NODE}_exe
# PARAM_FILENAMES "latlon_muxer_defaults.param.yaml"
# )
# add_smoke_test(${PROJECT_NAME} ${LATERAL_CONTROLLER_NODE}_exe
# PARAM_FILENAMES "lateral_controller_defaults.param.yaml test_vehicle_info.param.yaml"
# )
# add_smoke_test(${PROJECT_NAME} ${LONGITUDINAL_CONTROLLER_NODE}_exe
# PARAM_FILENAMES "longitudinal_controller_defaults.param.yaml test_vehicle_info.param.yaml"
# )
endif()

ament_auto_package(
Expand Down

This file was deleted.

Loading

0 comments on commit 657beb8

Please sign in to comment.