Skip to content

Commit

Permalink
refactor(qp_interface): prefix package and namespace with autoware (#…
Browse files Browse the repository at this point in the history
…9236)

Signed-off-by: Esteve Fernandez <[email protected]>
  • Loading branch information
esteve authored Nov 6, 2024
1 parent 22157a0 commit d0ed04e
Show file tree
Hide file tree
Showing 19 changed files with 76 additions and 76 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ common/autoware_path_distance_calculator/** [email protected]
common/autoware_perception_rviz_plugin/** [email protected] [email protected] [email protected] [email protected] [email protected]
common/autoware_point_types/** [email protected] [email protected]
common/autoware_polar_grid/** [email protected]
common/autoware_qp_interface/** [email protected] [email protected] [email protected] [email protected]
common/autoware_signal_processing/** [email protected] [email protected] [email protected] [email protected] [email protected]
common/autoware_test_utils/** [email protected] [email protected] [email protected] [email protected]
common/autoware_testing/** [email protected] [email protected] [email protected] [email protected]
Expand All @@ -28,7 +29,6 @@ common/component_interface_utils/** [email protected] [email protected]
common/fake_test_node/** [email protected] [email protected] [email protected] [email protected]
common/global_parameter_loader/** [email protected]
common/glog_component/** [email protected]
common/qp_interface/** [email protected] [email protected] [email protected] [email protected]
common/tier4_adapi_rviz_plugin/** [email protected] [email protected] [email protected]
common/tier4_api_utils/** [email protected]
common/tier4_camera_view_rviz_plugin/** [email protected] [email protected]
Expand Down
2 changes: 1 addition & 1 deletion common/autoware_auto_common/design/comparisons.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ The `exclusive_or` function will test whether two values cast to different boole
#include <iostream>

// using-directive is just for illustration; don't do this in practice
using namespace autoware::common::helper_functions::comparisons;
using namespace autoware::qp_interface::helper_functions::comparisons;

static constexpr auto epsilon = 0.2;
static constexpr auto relative_epsilon = 0.01;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.14)
project(qp_interface)
project(autoware_qp_interface)

find_package(autoware_cmake REQUIRED)
autoware_package()
Expand All @@ -20,10 +20,10 @@ set(QP_INTERFACE_LIB_SRC
)

set(QP_INTERFACE_LIB_HEADERS
include/qp_interface/qp_interface.hpp
include/qp_interface/osqp_interface.hpp
include/qp_interface/osqp_csc_matrix_conv.hpp
include/qp_interface/proxqp_interface.hpp
include/autoware/qp_interface/qp_interface.hpp
include/autoware/qp_interface/osqp_interface.hpp
include/autoware/qp_interface/osqp_csc_matrix_conv.hpp
include/autoware/qp_interface/proxqp_interface.hpp
)

ament_auto_add_library(${PROJECT_NAME} SHARED
Expand All @@ -32,13 +32,13 @@ ament_auto_add_library(${PROJECT_NAME} SHARED
)
target_compile_options(${PROJECT_NAME} PRIVATE -Wno-error=old-style-cast -Wno-error=useless-cast)

target_include_directories(qp_interface
target_include_directories(${PROJECT_NAME}
SYSTEM PUBLIC
"${OSQP_INCLUDE_DIR}"
"${EIGEN3_INCLUDE_DIR}"
)

ament_target_dependencies(qp_interface
ament_target_dependencies(${PROJECT_NAME}
Eigen3
osqp_vendor
proxsuite
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Interface for QP solvers

This is the design document for the `qp_interface` package.
This is the design document for the `autoware_qp_interface` package.

## Purpose / Use cases

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef QP_INTERFACE__OSQP_CSC_MATRIX_CONV_HPP_
#define QP_INTERFACE__OSQP_CSC_MATRIX_CONV_HPP_
#ifndef AUTOWARE__QP_INTERFACE__OSQP_CSC_MATRIX_CONV_HPP_
#define AUTOWARE__QP_INTERFACE__OSQP_CSC_MATRIX_CONV_HPP_

#include "osqp/glob_opts.h"

#include <Eigen/Core>

#include <vector>

namespace autoware::common
namespace autoware::qp_interface
{
/// \brief Compressed-Column-Sparse Matrix
struct CSC_Matrix
Expand All @@ -41,6 +41,6 @@ CSC_Matrix calCSCMatrixTrapezoidal(const Eigen::MatrixXd & mat);
/// \brief Print the given CSC matrix to the standard output
void printCSCMatrix(const CSC_Matrix & csc_mat);

} // namespace autoware::common
} // namespace autoware::qp_interface

#endif // QP_INTERFACE__OSQP_CSC_MATRIX_CONV_HPP_
#endif // AUTOWARE__QP_INTERFACE__OSQP_CSC_MATRIX_CONV_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef QP_INTERFACE__OSQP_INTERFACE_HPP_
#define QP_INTERFACE__OSQP_INTERFACE_HPP_
#ifndef AUTOWARE__QP_INTERFACE__OSQP_INTERFACE_HPP_
#define AUTOWARE__QP_INTERFACE__OSQP_INTERFACE_HPP_

#include "autoware/qp_interface/osqp_csc_matrix_conv.hpp"
#include "autoware/qp_interface/qp_interface.hpp"
#include "osqp/osqp.h"
#include "qp_interface/osqp_csc_matrix_conv.hpp"
#include "qp_interface/qp_interface.hpp"

#include <limits>
#include <memory>
#include <string>
#include <vector>

namespace autoware::common
namespace autoware::qp_interface
{
constexpr c_float OSQP_INF = 1e30;

Expand Down Expand Up @@ -142,6 +142,6 @@ class OSQPInterface : public QPInterface

std::vector<double> optimizeImpl() override;
};
} // namespace autoware::common
} // namespace autoware::qp_interface

#endif // QP_INTERFACE__OSQP_INTERFACE_HPP_
#endif // AUTOWARE__QP_INTERFACE__OSQP_INTERFACE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef QP_INTERFACE__PROXQP_INTERFACE_HPP_
#define QP_INTERFACE__PROXQP_INTERFACE_HPP_
#ifndef AUTOWARE__QP_INTERFACE__PROXQP_INTERFACE_HPP_
#define AUTOWARE__QP_INTERFACE__PROXQP_INTERFACE_HPP_

#include "qp_interface/qp_interface.hpp"
#include "autoware/qp_interface/qp_interface.hpp"

#include <proxsuite/helpers/optional.hpp>
#include <proxsuite/proxqp/sparse/sparse.hpp>
Expand All @@ -25,7 +25,7 @@
#include <string>
#include <vector>

namespace autoware::common
namespace autoware::qp_interface
{
class ProxQPInterface : public QPInterface
{
Expand All @@ -52,6 +52,6 @@ class ProxQPInterface : public QPInterface

std::vector<double> optimizeImpl() override;
};
} // namespace autoware::common
} // namespace autoware::qp_interface

#endif // QP_INTERFACE__PROXQP_INTERFACE_HPP_
#endif // AUTOWARE__QP_INTERFACE__PROXQP_INTERFACE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef QP_INTERFACE__QP_INTERFACE_HPP_
#define QP_INTERFACE__QP_INTERFACE_HPP_
#ifndef AUTOWARE__QP_INTERFACE__QP_INTERFACE_HPP_
#define AUTOWARE__QP_INTERFACE__QP_INTERFACE_HPP_

#include <Eigen/Core>

#include <optional>
#include <string>
#include <vector>

namespace autoware::common
namespace autoware::qp_interface
{
class QPInterface
{
Expand Down Expand Up @@ -56,6 +56,6 @@ class QPInterface
std::optional<size_t> variables_num_{std::nullopt};
std::optional<size_t> constraints_num_{std::nullopt};
};
} // namespace autoware::common
} // namespace autoware::qp_interface

#endif // QP_INTERFACE__QP_INTERFACE_HPP_
#endif // AUTOWARE__QP_INTERFACE__QP_INTERFACE_HPP_
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?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>qp_interface</name>
<name>autoware_qp_interface</name>
<version>1.0.0</version>
<description>Interface for the QP solvers</description>
<maintainer email="[email protected]">Takayuki Murooka</maintainer>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "qp_interface/osqp_csc_matrix_conv.hpp"
#include "autoware/qp_interface/osqp_csc_matrix_conv.hpp"

#include <Eigen/Core>
#include <Eigen/SparseCore>
Expand All @@ -21,7 +21,7 @@
#include <iostream>
#include <vector>

namespace autoware::common
namespace autoware::qp_interface
{
CSC_Matrix calCSCMatrix(const Eigen::MatrixXd & mat)
{
Expand Down Expand Up @@ -131,4 +131,4 @@ void printCSCMatrix(const CSC_Matrix & csc_mat)
}
std::cout << "]\n";
}
} // namespace autoware::common
} // namespace autoware::qp_interface
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "qp_interface/osqp_interface.hpp"
#include "autoware/qp_interface/osqp_interface.hpp"

#include "qp_interface/osqp_csc_matrix_conv.hpp"
#include "autoware/qp_interface/osqp_csc_matrix_conv.hpp"

#include <rclcpp/rclcpp.hpp>

namespace autoware::common
namespace autoware::qp_interface
{
OSQPInterface::OSQPInterface(
const bool enable_warm_start, const int max_iteration, const c_float eps_abs,
Expand Down Expand Up @@ -386,4 +386,4 @@ std::vector<double> OSQPInterface::optimize(
return result;
}

} // namespace autoware::common
} // namespace autoware::qp_interface
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "qp_interface/proxqp_interface.hpp"
#include "autoware/qp_interface/proxqp_interface.hpp"

namespace autoware::common
namespace autoware::qp_interface
{
using proxsuite::proxqp::QPSolverOutput;

Expand Down Expand Up @@ -150,4 +150,4 @@ std::vector<double> ProxQPInterface::optimizeImpl()
}
return result;
}
} // namespace autoware::common
} // namespace autoware::qp_interface
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "qp_interface/qp_interface.hpp"
#include "autoware/qp_interface/qp_interface.hpp"

#include <iostream>
#include <string>
#include <vector>

namespace autoware::common
namespace autoware::qp_interface
{
void QPInterface::initializeProblem(
const Eigen::MatrixXd & P, const Eigen::MatrixXd & A, const std::vector<double> & q,
Expand Down Expand Up @@ -67,4 +67,4 @@ std::vector<double> QPInterface::optimize(

return result;
}
} // namespace autoware::common
} // namespace autoware::qp_interface
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#include "autoware/qp_interface/osqp_csc_matrix_conv.hpp"
#include "gtest/gtest.h"
#include "qp_interface/osqp_csc_matrix_conv.hpp"

#include <Eigen/Core>

Expand All @@ -23,8 +23,8 @@

TEST(TestCscMatrixConv, Nominal)
{
using autoware::common::calCSCMatrix;
using autoware::common::CSC_Matrix;
using autoware::qp_interface::calCSCMatrix;
using autoware::qp_interface::CSC_Matrix;

Eigen::MatrixXd rect1(1, 2);
rect1 << 0.0, 1.0;
Expand Down Expand Up @@ -117,8 +117,8 @@ TEST(TestCscMatrixConv, Nominal)
}
TEST(TestCscMatrixConv, Trapezoidal)
{
using autoware::common::calCSCMatrixTrapezoidal;
using autoware::common::CSC_Matrix;
using autoware::qp_interface::calCSCMatrixTrapezoidal;
using autoware::qp_interface::CSC_Matrix;

Eigen::MatrixXd square1(2, 2);
Eigen::MatrixXd square2(3, 3);
Expand Down Expand Up @@ -166,10 +166,10 @@ TEST(TestCscMatrixConv, Trapezoidal)
}
TEST(TestCscMatrixConv, Print)
{
using autoware::common::calCSCMatrix;
using autoware::common::calCSCMatrixTrapezoidal;
using autoware::common::CSC_Matrix;
using autoware::common::printCSCMatrix;
using autoware::qp_interface::calCSCMatrix;
using autoware::qp_interface::calCSCMatrixTrapezoidal;
using autoware::qp_interface::CSC_Matrix;
using autoware::qp_interface::printCSCMatrix;
Eigen::MatrixXd square1(2, 2);
Eigen::MatrixXd rect1(1, 2);
square1 << 1.0, 2.0, 2.0, 4.0;
Expand Down
Loading

0 comments on commit d0ed04e

Please sign in to comment.