8#include <sleipnir/autodiff/variable.hpp>
9#include <sleipnir/optimization/problem.hpp>
11#include "trajopt/geometry/pose2.hpp"
12#include "trajopt/geometry/translation2.hpp"
13#include "trajopt/util/symbol_exports.hpp"
30 Translation2d field_point,
32 : m_robot_point{std::move(robot_point)},
33 m_field_point{std::move(field_point)},
34 m_max_distance{max_distance} {
35 assert(max_distance >= 0.0);
47 slp::Problem<double>& problem,
const Pose2v<double>& pose,
48 [[maybe_unused]]
const Translation2v<double>& linear_velocity,
49 [[maybe_unused]]
const slp::Variable<double>& angular_velocity,
50 [[maybe_unused]]
const Translation2v<double>& linear_acceleration,
51 [[maybe_unused]]
const slp::Variable<double>& angular_acceleration) {
54 auto dx = m_field_point.x() - bumper_corner.x();
55 auto dy = m_field_point.y() - bumper_corner.y();
56 problem.subject_to(dx * dx + dy * dy <= m_max_distance * m_max_distance);
60 Translation2d m_robot_point;
61 Translation2d m_field_point;
62 double m_max_distance;
void apply(slp::Problem< double > &problem, const Pose2v< double > &pose, const Translation2v< double > &linear_velocity, const slp::Variable< double > &angular_velocity, const Translation2v< double > &linear_acceleration, const slp::Variable< double > &angular_acceleration)
Definition point_point_max_constraint.hpp:46
PointPointMaxConstraint(Translation2d robot_point, Translation2d field_point, double max_distance)
Definition point_point_max_constraint.hpp:29
constexpr const Rotation2< T > & rotation() const
Definition pose2.hpp:66
constexpr const Translation2< T > & translation() const
Definition pose2.hpp:51
constexpr auto rotate_by(const Rotation2< U > &rotation) const
Definition translation2.hpp:117