backup
This commit is contained in:
parent
fa9828aced
commit
9e3f69a00e
|
@ -10,6 +10,7 @@
|
|||
#include "carla/road/RoadTypes.h"
|
||||
|
||||
#include <vector>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
|
||||
namespace carla {
|
||||
|
@ -50,6 +51,8 @@ namespace road {
|
|||
if (_lane_section != nullptr) {
|
||||
return _info.GetInfo<T>(s - GetDistance());
|
||||
}
|
||||
|
||||
std::cout << "[DEBUG] info is null!" << std::endl;
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
|
@ -174,9 +174,15 @@ namespace road {
|
|||
}
|
||||
}
|
||||
|
||||
// Make sure 0.0 < waipoint.s < Road's lenght
|
||||
const auto road_len = _data.GetRoad(waypoint.road_id).GetLength();
|
||||
waypoint.s = geom::Math::clamp<float>(waypoint.s, 0.0, road_len);
|
||||
const auto &road = _data.GetRoad(waypoint.road_id);
|
||||
|
||||
// Make sure 0.0 < waipoint.s < Road's length
|
||||
waypoint.s = geom::Math::clamp<float>(waypoint.s, 0.0, road.GetLength());
|
||||
|
||||
auto &lane = road.GetLaneByDistance(waypoint.s, waypoint.lane_id);
|
||||
|
||||
const auto lane_section_id = lane.GetLaneSection()->GetId();
|
||||
waypoint.section_id = lane_section_id;
|
||||
|
||||
return waypoint;
|
||||
}
|
||||
|
@ -289,6 +295,11 @@ namespace road {
|
|||
Map::GetMarkRecord(const Waypoint waypoint) const {
|
||||
const auto s = waypoint.s;
|
||||
|
||||
std::cout << "[DEBUG] GetMarkRecord: road_id: " << waypoint.road_id << std::endl;
|
||||
std::cout << "[DEBUG] GetMarkRecord: section_id: " << waypoint.section_id << std::endl;
|
||||
std::cout << "[DEBUG] GetMarkRecord: lane_id: " << waypoint.lane_id << std::endl;
|
||||
std::cout << "[DEBUG] GetMarkRecord: s: " << waypoint.s << std::endl << std::endl;
|
||||
|
||||
const auto ¤t_lane = GetLane(waypoint);
|
||||
THROW_INVALID_INPUT_ASSERT(s <= current_lane.GetRoad()->GetLength());
|
||||
|
||||
|
|
|
@ -43,6 +43,7 @@ namespace road {
|
|||
}
|
||||
|
||||
for (auto &&info : _temp_lane_info_container) {
|
||||
if (info.first->GetRoad()->GetId() == 65 && info.first->GetId() == -1) {std::cout << "[DEBUG] " << std::hex << info.first << std::dec << std::endl;}
|
||||
info.first->_info = InformationSet(std::move(info.second));
|
||||
}
|
||||
|
||||
|
|
|
@ -79,6 +79,9 @@ namespace road {
|
|||
}
|
||||
|
||||
Lane &Road::GetLaneById(SectionId section_id, LaneId lane_id) {
|
||||
std::cout << "[DEBUG] at() road_id: " << GetId() << std::endl;
|
||||
std::cout << "[DEBUG] at() section_id: " << section_id << std::endl;
|
||||
std::cout << "[DEBUG] at() lane_id: " << lane_id << std::endl << std::endl;
|
||||
return GetLaneSectionById(section_id).GetLanes().at(lane_id);
|
||||
}
|
||||
|
||||
|
@ -235,8 +238,15 @@ namespace road {
|
|||
// dp_lane_zero.location.y *= -1;
|
||||
|
||||
DirectedPoint current_dp = dp_lane_zero;
|
||||
std::cout << "[DEBUG] GetNearestLane (road_id " << GetId() << ")" << std::endl;
|
||||
for (const auto &lane : right_lanes) {
|
||||
std::cout << "[DEBUG] lane_id " << std::hex << (uint64_t)lane.second << std::endl;
|
||||
std::cout << "[DEBUG] lane_id " << std::dec << lane.first << std::endl;
|
||||
std::cout << "[DEBUG] s " << s << std::endl;
|
||||
|
||||
const auto lane_width_info = lane.second->GetInfo<RoadInfoLaneWidth>(s);
|
||||
std::cout << "[DEBUG] lane_id " << std::hex << lane_width_info << std::dec << std::endl;
|
||||
|
||||
const auto half_width = lane_width_info->GetPolynomial().Evaluate(s) / 2.0f;
|
||||
current_dp.ApplyLateralOffset(half_width);
|
||||
const auto current_dist = geom::Math::Distance(current_dp.location, loc);
|
||||
|
|
|
@ -58,8 +58,6 @@ namespace road {
|
|||
|
||||
RoadId GetPredecessor() const;
|
||||
|
||||
Lane *GetLane(const LaneId id, const float s);
|
||||
|
||||
Lane &GetLaneById(SectionId section_id, LaneId lane_id);
|
||||
|
||||
const Lane &GetLaneById(SectionId section_id, LaneId lane_id) const;
|
||||
|
|
Loading…
Reference in New Issue