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

feat: apply autoware_ prefix for learning_based_vehicle_model #9991

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package learning_based_vehicle_model
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Changelog for package autoware_learning_based_vehicle_model
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0.40.0 (2024-12-12)
-------------------
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14.4)
project(learning_based_vehicle_model)
project(autoware_learning_based_vehicle_model)

find_package(autoware_cmake REQUIRED)
autoware_package()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 The Autoware Foundation.
// Copyright 2025 The Autoware Foundation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -12,12 +12,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LEARNING_BASED_VEHICLE_MODEL__INTERCONNECTED_MODEL_HPP_
#define LEARNING_BASED_VEHICLE_MODEL__INTERCONNECTED_MODEL_HPP_
#ifndef AUTOWARE__LEARNING_BASED_VEHICLE_MODEL__INTERCONNECTED_MODEL_HPP_
#define AUTOWARE__LEARNING_BASED_VEHICLE_MODEL__INTERCONNECTED_MODEL_HPP_

#include "learning_based_vehicle_model/model_connections_helpers.hpp"
#include "learning_based_vehicle_model/simple_pymodel.hpp"
#include "learning_based_vehicle_model/submodel_interface.hpp"
#include "autoware/learning_based_vehicle_model/model_connections_helpers.hpp"
#include "autoware/learning_based_vehicle_model/simple_pymodel.hpp"
#include "autoware/learning_based_vehicle_model/submodel_interface.hpp"

#include <dlfcn.h>
#include <pybind11/embed.h>
Expand All @@ -29,6 +29,9 @@
#include <tuple>
#include <vector>

namespace autoware::simulator::learning_based_vehicle_model
{

namespace py = pybind11;

class __attribute__((visibility("default"))) InterconnectedModel
Expand Down Expand Up @@ -127,4 +130,6 @@ class __attribute__((visibility("default"))) InterconnectedModel
std::vector<double> updatePyModel(std::vector<double> psim_input);
};

#endif // LEARNING_BASED_VEHICLE_MODEL__INTERCONNECTED_MODEL_HPP_
} // namespace autoware::simulator::learning_based_vehicle_model

#endif // AUTOWARE__LEARNING_BASED_VEHICLE_MODEL__INTERCONNECTED_MODEL_HPP_
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 The Autoware Foundation.
// Copyright 2025 The Autoware Foundation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -12,17 +12,22 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LEARNING_BASED_VEHICLE_MODEL__MODEL_CONNECTIONS_HELPERS_HPP_
#define LEARNING_BASED_VEHICLE_MODEL__MODEL_CONNECTIONS_HELPERS_HPP_
#ifndef AUTOWARE__LEARNING_BASED_VEHICLE_MODEL__MODEL_CONNECTIONS_HELPERS_HPP_
#define AUTOWARE__LEARNING_BASED_VEHICLE_MODEL__MODEL_CONNECTIONS_HELPERS_HPP_

#include <cstring>
#include <vector>

namespace autoware::simulator::learning_based_vehicle_model
{

std::vector<double> fillVectorUsingMap(
std::vector<double> vector1, std::vector<double> vector2, const std::vector<int> & map,
bool inverse);

std::vector<int> createConnectionsMap(
const std::vector<char *> & connection_names_1, const std::vector<char *> & connection_names_2);

#endif // LEARNING_BASED_VEHICLE_MODEL__MODEL_CONNECTIONS_HELPERS_HPP_
} // namespace autoware::simulator::learning_based_vehicle_model

#endif // AUTOWARE__LEARNING_BASED_VEHICLE_MODEL__MODEL_CONNECTIONS_HELPERS_HPP_
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 The Autoware Foundation.
// Copyright 2025 The Autoware Foundation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -13,18 +13,21 @@
// limitations under the License.

// cspell:ignore pymodel
#ifndef LEARNING_BASED_VEHICLE_MODEL__SIMPLE_PYMODEL_HPP_
#define LEARNING_BASED_VEHICLE_MODEL__SIMPLE_PYMODEL_HPP_
#ifndef AUTOWARE__LEARNING_BASED_VEHICLE_MODEL__SIMPLE_PYMODEL_HPP_
#define AUTOWARE__LEARNING_BASED_VEHICLE_MODEL__SIMPLE_PYMODEL_HPP_

#include "learning_based_vehicle_model/model_connections_helpers.hpp"
#include "learning_based_vehicle_model/submodel_interface.hpp"
#include "autoware/learning_based_vehicle_model/model_connections_helpers.hpp"
#include "autoware/learning_based_vehicle_model/submodel_interface.hpp"

#include <pybind11/embed.h>
#include <pybind11/stl.h>

#include <string>
#include <vector>

namespace autoware::simulator::learning_based_vehicle_model
{

namespace py = pybind11;

/**
Expand Down Expand Up @@ -99,4 +102,6 @@ class SimplePyModel : public SubModelInterface
void mapOutputs(std::vector<char *> signals_vec_names) override;
};

#endif // LEARNING_BASED_VEHICLE_MODEL__SIMPLE_PYMODEL_HPP_
} // namespace autoware::simulator::learning_based_vehicle_model

#endif // AUTOWARE__LEARNING_BASED_VEHICLE_MODEL__SIMPLE_PYMODEL_HPP_
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 The Autoware Foundation.
// Copyright 2025 The Autoware Foundation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -12,11 +12,14 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef LEARNING_BASED_VEHICLE_MODEL__SUBMODEL_INTERFACE_HPP_
#define LEARNING_BASED_VEHICLE_MODEL__SUBMODEL_INTERFACE_HPP_
#ifndef AUTOWARE__LEARNING_BASED_VEHICLE_MODEL__SUBMODEL_INTERFACE_HPP_
#define AUTOWARE__LEARNING_BASED_VEHICLE_MODEL__SUBMODEL_INTERFACE_HPP_

#include <vector>

namespace autoware::simulator::learning_based_vehicle_model
{

class SubModelInterface
{
public:
Expand Down Expand Up @@ -59,4 +62,6 @@ class SubModelInterface
std::vector<double> model_signals_vec, std::vector<double> model_signals_vec_next) = 0;
};

#endif // LEARNING_BASED_VEHICLE_MODEL__SUBMODEL_INTERFACE_HPP_
} // namespace autoware::simulator::learning_based_vehicle_model

#endif // AUTOWARE__LEARNING_BASED_VEHICLE_MODEL__SUBMODEL_INTERFACE_HPP_
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>learning_based_vehicle_model</name>
<name>autoware_learning_based_vehicle_model</name>
<version>0.40.0</version>
<description>learning_based_vehicle_model for simple_planning_simulator</description>
<description>autoware_learning_based_vehicle_model for simple_planning_simulator</description>
<maintainer email="maxime.clement@tier4.jp">Maxime Clement</maintainer>
<maintainer email="nagy.tomas@tier4.jp">Tomas Nagy</maintainer>
<maintainer email="junya.sasaki@tier4.jp">Junya Sasaki</maintainer>
<license>Apache License 2.0</license>

<buildtool_depend>ament_cmake_auto</buildtool_depend>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 The Autoware Foundation.
// Copyright 2025 The Autoware Foundation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -12,12 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "learning_based_vehicle_model/interconnected_model.hpp"
#include "autoware/learning_based_vehicle_model/interconnected_model.hpp"

#include <string>
#include <tuple>
#include <vector>

namespace autoware::simulator::learning_based_vehicle_model
{

void InterconnectedModel::mapInputs(std::vector<char *> in_names)
{
// index in "map_in_to_sig_vec" is index in "in_names" and value in "map_in_to_sig_vec" is index
Expand Down Expand Up @@ -139,3 +142,5 @@ std::vector<double> InterconnectedModel::updatePyModel(std::vector<double> psim_

return psim_next_state;
}

} // namespace autoware::simulator::learning_based_vehicle_model
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 The Autoware Foundation.
// Copyright 2025 The Autoware Foundation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -12,10 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "learning_based_vehicle_model/model_connections_helpers.hpp"
#include "autoware/learning_based_vehicle_model/model_connections_helpers.hpp"

#include <vector>

namespace autoware::simulator::learning_based_vehicle_model
{

std::vector<double> fillVectorUsingMap(
std::vector<double> vector1, std::vector<double> vector2, const std::vector<int> & map,
bool inverse)
Expand Down Expand Up @@ -48,3 +51,5 @@ std::vector<int> createConnectionsMap(
}
return connection_map;
}

} // namespace autoware::simulator::learning_based_vehicle_model
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 The Autoware Foundation.
// Copyright 2025 The Autoware Foundation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -12,14 +12,17 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "learning_based_vehicle_model/simple_pymodel.hpp"
#include "autoware/learning_based_vehicle_model/simple_pymodel.hpp"

#include <pybind11/embed.h>
#include <pybind11/stl.h>

#include <string>
#include <vector>

namespace autoware::simulator::learning_based_vehicle_model
{

namespace py = pybind11;

SimplePyModel::SimplePyModel(
Expand Down Expand Up @@ -110,3 +113,5 @@ void SimplePyModel::mapOutputs(std::vector<char *> signals_vec_names)
// "map_py_model_outputs_to_sig_vec" is index in "signals_vec_names"
map_py_model_outputs_to_sig_vec = createConnectionsMap(signals_vec_names, py_model_state_names);
}

} // namespace autoware::simulator::learning_based_vehicle_model
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2024 The Autoware Foundation.
// Copyright 2025 The Autoware Foundation.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand All @@ -12,4 +12,4 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "learning_based_vehicle_model/submodel_interface.hpp"
#include "autoware/learning_based_vehicle_model/submodel_interface.hpp"
4 changes: 2 additions & 2 deletions simulator/autoware_simple_planning_simulator/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ project(autoware_simple_planning_simulator)

find_package(autoware_cmake REQUIRED)
find_package(Python3 COMPONENTS Interpreter Development)
find_package(learning_based_vehicle_model REQUIRED)
find_package(autoware_learning_based_vehicle_model REQUIRED)
autoware_package()

# Component
Expand All @@ -25,7 +25,7 @@ ament_auto_add_library(${PROJECT_NAME} SHARED
src/simple_planning_simulator/utils/csv_loader.cpp
src/simple_planning_simulator/utils/mechanical_controller.cpp
)
target_include_directories(${PROJECT_NAME} PUBLIC ${Python3_INCLUDE_DIRS} ${learning_based_vehicle_model_INCLUDE_DIRS})
target_include_directories(${PROJECT_NAME} PUBLIC ${Python3_INCLUDE_DIRS} ${autoware_learning_based_vehicle_model_INCLUDE_DIRS})
# Node executable
rclcpp_components_register_node(${PROJECT_NAME}
PLUGIN "autoware::simulator::simple_planning_simulator::SimplePlanningSimulator"
Expand Down
2 changes: 1 addition & 1 deletion simulator/autoware_simple_planning_simulator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The purpose of this simulator is for the integration test of planning and contro
- `DELAY_STEER_ACC_GEARED`
- `DELAY_STEER_ACC_GEARED_WO_FALL_GUARD`
- `DELAY_STEER_MAP_ACC_GEARED`: applies 1D dynamics and time delay to the steering and acceleration commands. The simulated acceleration is determined by a value converted through the provided acceleration map. This model is valuable for an accurate simulation with acceleration deviations in a real vehicle.
- `LEARNED_STEER_VEL`: launches learned python models. More about this [here](../learning_based_vehicle_model).
- `LEARNED_STEER_VEL`: launches learned python models. More about this [here](../autoware_learning_based_vehicle_model).

The following models receive `ACTUATION_CMD` generated from `raw_vehicle_cmd_converter`. Therefore, when these models are selected, the `raw_vehicle_cmd_converter` is also launched.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#ifndef AUTOWARE__SIMPLE_PLANNING_SIMULATOR__VEHICLE_MODEL__SIM_MODEL_LEARNED_STEER_VEL_HPP_
#define AUTOWARE__SIMPLE_PLANNING_SIMULATOR__VEHICLE_MODEL__SIM_MODEL_LEARNED_STEER_VEL_HPP_

#include "autoware/learning_based_vehicle_model/interconnected_model.hpp"
#include "autoware/simple_planning_simulator/vehicle_model/sim_model_interface.hpp"
#include "learning_based_vehicle_model/interconnected_model.hpp"

#include <Eigen/Core>
#include <Eigen/LU>
Expand Down Expand Up @@ -77,7 +77,7 @@ class SimModelLearnedSteerVel : public SimModelInterface /*delay steer velocity*
STEER_DES,
};

InterconnectedModel vehicle;
autoware::simulator::learning_based_vehicle_model::InterconnectedModel vehicle;

double prev_vx_ = 0.0;
double current_ax_ = 0.0;
Expand Down
2 changes: 1 addition & 1 deletion simulator/autoware_simple_planning_simulator/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

<depend>autoware_control_msgs</depend>
<depend>autoware_lanelet2_extension</depend>
<depend>autoware_learning_based_vehicle_model</depend>
<depend>autoware_map_msgs</depend>
<depend>autoware_motion_utils</depend>
<depend>autoware_planning_msgs</depend>
Expand All @@ -27,7 +28,6 @@
<depend>autoware_vehicle_msgs</depend>
<depend>geometry_msgs</depend>
<depend>lanelet2_core</depend>
<depend>learning_based_vehicle_model</depend>
<depend>nav_msgs</depend>
<depend>rclcpp</depend>
<depend>rclcpp_components</depend>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "autoware/simple_planning_simulator/vehicle_model/sim_model_learned_steer_vel.hpp"

#include "learning_based_vehicle_model/interconnected_model.hpp"
#include "autoware/learning_based_vehicle_model/interconnected_model.hpp"

#include <algorithm>
#include <string>
Expand Down
Loading