提交 86e34f7e 编写于 作者: J jiangyifei 提交者: Jiangtao Hu

added prediction traj in obstacle

上级 c7fff3d0
......@@ -50,6 +50,7 @@ cc_library(
deps = [
"//modules/common/math:box2d",
"//modules/planning/common:planning_object",
"//modules/planning/common/trajectory:prediction_trajectory",
],
)
......@@ -127,13 +128,12 @@ cc_library(
"frame.h",
],
deps = [
"//modules/planning/common:planning_data",
"//modules/planning/common:environment",
"//modules/common:log",
"//modules/planning/common:environment",
"//modules/planning/common:planning_data",
],
)
cc_library(
name = "speed_limit",
srcs = [
......@@ -161,8 +161,8 @@ cc_library(
":frame",
":planning_data",
":planning_gflags",
"//modules/common/status",
"//modules/common",
"//modules/common/status",
"//modules/planning/state_machine:master_state_machine",
],
)
......@@ -171,8 +171,8 @@ cc_library(
name = "planning_common",
deps = [
"@eigen//:eigen",
":frame",
":data_center",
":frame",
":planning_gflags",
":speed_limit",
"//modules/common:log",
......
......@@ -24,7 +24,7 @@ namespace apollo {
namespace planning {
std::string MapObject::Id() const {
return id_;
return id_;
}
} // namespace planning
......
......@@ -27,12 +27,12 @@ namespace apollo {
namespace planning {
class MapObject : public PlanningObject {
public:
MapObject() = default;
std::string Id() const;
public:
MapObject() = default;
std::string Id() const;
private:
std::string id_;
private:
std::string id_;
};
} // namespace planning
......
......@@ -20,86 +20,76 @@
#include "modules/planning/common/obstacle.h"
//#include <sstream>
#include <sstream>
namespace apollo {
namespace planning {
int Obstacle::Id() const {
return id_;
return id_;
}
void Obstacle::SetId(int id) {
id_ = id;
id_ = id;
}
double Obstacle::Height() const {
return height_;
return height_;
}
void Obstacle::SetHeight(const double height) {
height_ = height;
height_ = height;
}
double Obstacle::Width() const {
return width_;
return width_;
}
void Obstacle::SetWidth(const double width) {
width_ = width;
width_ = width;
}
double Obstacle::Length() const {
return length_;
return length_;
}
void Obstacle::SetLength(const double length) {
length_ = length;
length_ = length;
}
double Obstacle::Heading() const {
return heading_;
return heading_;
}
void Obstacle::SetHeading(const double heading) {
heading_ = heading;
heading_ = heading;
}
::apollo::common::math::Box2d Obstacle::BoundingBox() const {
return ::apollo::common::math::Box2d(center_, heading_, length_, width_);
return ::apollo::common::math::Box2d(center_, heading_, length_, width_);
}
const Obstacle::ObstacleType& Obstacle::Type() const {
return type_;
const Obstacle::ObstacleType &Obstacle::Type() const {
return type_;
}
void Obstacle::SetType(const ObstacleType& type) {
type_ = type;
void Obstacle::SetType(const ObstacleType &type) {
type_ = type;
}
// TODO: to be added
/*
const std::vector<PredictionTrajectory>&
const std::vector<PredictionTrajectory> &
Obstacle::prediction_trajectories() const {
return _prediction_trajectories;
return prediction_trajectories_;
}
*/
// TODO: to be added
/*
void Obstacle::add_prediction_trajectory(
const PredictionTrajectory& prediction_trajectory) {
_prediction_trajectories.push_back(prediction_trajectory);
const PredictionTrajectory &prediction_trajectory) {
prediction_trajectories_.push_back(prediction_trajectory);
}
*/
// TODO: to be added
/*
std::vector<PredictionTrajectory>* Obstacle::mutable_prediction_trajectories() {
return &_prediction_trajectories;
std::vector<PredictionTrajectory> *Obstacle::mutable_prediction_trajectories() {
return &prediction_trajectories_;
}
*/
} // namespace planning
} // namespace apollo
} // namespace planning
} // namespace apollo
......@@ -26,64 +26,62 @@
#include <vector>
#include "modules/common/math/box2d.h"
//#include "common/trajectory/prediction_trajectory.h"
#include "modules/planning/common/trajectory/prediction_trajectory.h"
namespace apollo {
namespace planning {
class Obstacle : public PlanningObject {
public:
enum class ObstacleType {
UNKNOWN = 0,
UNKNOWN_MOVABLE = 1,
UNKNOWN_UNMOVABLE = 2,
PEDESTRIAN = 3,
BICYCLE = 4,
VEHICLE = 5,
};
Obstacle() = default;
int Id() const;
void SetId(int id);
const ObstacleType& Type() const;
void SetType(const ObstacleType& type);
double Height() const;
void SetHeight(const double height);
double Width() const;
void SetWidth(const double width);
double Length() const;
void SetLength(const double length);
double Heading() const;
void SetHeading(const double heading);
::apollo::common::math::Box2d BoundingBox() const;
// TODO: to be added
//const std::vector<PredictionTrajectory>& prediction_trajectories() const;
//void add_prediction_trajectory(
// const PredictionTrajectory& prediction_trajectory);
//std::vector<PredictionTrajectory>* mutable_prediction_trajectories();
private:
int id_ = 0;
double height_ = 0.0;
double width_ = 0.0;
double length_ = 0.0;
double heading_ = 0.0;
::apollo::common::math::Vec2d center_;
// TODO: to be added
//std::vector<PredictionTrajectory> prediction_trajectories_;
ObstacleType type_ = ObstacleType::VEHICLE;
public:
enum class ObstacleType {
UNKNOWN = 0,
UNKNOWN_MOVABLE = 1,
UNKNOWN_UNMOVABLE = 2,
PEDESTRIAN = 3,
BICYCLE = 4,
VEHICLE = 5,
};
Obstacle() = default;
int Id() const;
void SetId(int id);
const ObstacleType &Type() const;
void SetType(const ObstacleType &type);
double Height() const;
void SetHeight(const double height);
double Width() const;
void SetWidth(const double width);
double Length() const;
void SetLength(const double length);
double Heading() const;
void SetHeading(const double heading);
::apollo::common::math::Box2d BoundingBox() const;
const std::vector<PredictionTrajectory> &prediction_trajectories() const;
void add_prediction_trajectory(
const PredictionTrajectory &prediction_trajectory);
std::vector<PredictionTrajectory> *mutable_prediction_trajectories();
private:
int id_ = 0;
double height_ = 0.0;
double width_ = 0.0;
double length_ = 0.0;
double heading_ = 0.0;
::apollo::common::math::Vec2d center_;
std::vector<PredictionTrajectory> prediction_trajectories_;
ObstacleType type_ = ObstacleType::VEHICLE;
};
} // namespace planning
} // namespace apollo
} // namespace planning
} // namespace apollo
#endif // MODULES_PLANNING_COMMON_OBSTACLE_H
#endif // MODULES_PLANNING_COMMON_OBSTACLE_H
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册