21 #include <adore_if_ros_msg/LinearPiecewiseFunction3d.h>
22 #include <adore_if_ros_msg/LaneGeometry.h>
23 #include <adore_if_ros_msg/LaneFollowingGeometry.h>
24 #include <adore_if_ros_msg/LaneChangeGeometry.h>
25 #include <std_msgs/Float64.h>
37 void operator()(adore_if_ros_msg::LaneGeometryConstPtr msg,
40 if (msg->centerlane.isValid)
44 if (msg->leftlane.isValid)
49 if (msg->rightlane.isValid)
56 void copyLanefromMsg(std::shared_ptr<adore::env::BorderBased::LaneGeometryDataProxy> lane,
57 adore_if_ros_msg::LaneFollowingGeometry
const& msg)
59 copyto(lane->centerSmoothed_fct, msg.centerline);
60 copyto(lane->leftDistance_fct, msg.leftDistance);
61 copyto(lane->rightDistance_fct, msg.rightDistance);
62 copyto(lane->centerNormal_fct, msg.centerNormal);
63 copyto(lane->centerSmoothedCurvature_fct, msg.centerCurvature);
64 copyto(lane->centerSmoothedCurvatureDerivative_fct, msg.centerCurvatureDerivative);
65 copyto(lane->navigationCost_fct, msg.navigationCost);
66 copyto(lane->speedLimit_fct, msg.speedLimit);
67 copyto(lane->left_indicator_hint_fct, msg.leftIndicatorHint);
68 copyto(lane->right_indicator_hint_fct, msg.rightIndicatorHint);
69 lane->isValid = msg.isValid;
73 adore_if_ros_msg::LaneChangeGeometry
const& msg)
75 lane->gate_s0 = msg.gate_s0;
76 lane->gate_s1 = msg.gate_s1;
79 case adore_if_ros_msg::LaneChangeGeometry::LEFT:
82 case adore_if_ros_msg::LaneChangeGeometry::RIGHT:
86 throw std::logic_error(
"Undefine value for direction in LaneChangeGeometry msg");
88 lane->isValid = msg.isValid;
89 copyto(lane->targetOuterBorderDistance_fct, msg.targetOuterBorderDistance);
90 copyto(lane->separatingBorderDistance_fct, msg.separatingBorderDistance);
91 copyto(lane->sourceOuterBorderDistance_fct, msg.sourceOuterBorderDistance);
100 adore_if_ros_msg::LaneGeometry msg;
101 if (combined.
center->isValid)
119 std::shared_ptr<adore::env::BorderBased::LaneGeometryDataProxy> lane)
121 msg.isValid = lane->isValid;
122 copyto(msg.centerline, lane->centerSmoothed_fct);
123 copyto(msg.leftDistance, lane->leftDistance_fct);
124 copyto(msg.rightDistance, lane->rightDistance_fct);
125 copyto(msg.centerNormal, lane->centerNormal_fct);
126 copyto(msg.centerCurvature, lane->centerSmoothedCurvature_fct);
127 copyto(msg.centerCurvatureDerivative, lane->centerSmoothedCurvatureDerivative_fct);
128 copyto(msg.navigationCost, lane->navigationCost_fct);
129 copyto(msg.speedLimit, lane->speedLimit_fct);
130 copyto(msg.leftIndicatorHint, lane->left_indicator_hint_fct);
131 copyto(msg.rightIndicatorHint, lane->right_indicator_hint_fct);
135 std::shared_ptr<adore::env::BorderBased::LaneChangeDataProxy> lane)
137 msg.isValid = lane->isValid;
138 msg.gate_s0 = lane->gate_s0;
139 msg.gate_s1 = lane->gate_s1;
140 msg.direction =
static_cast<int>(lane->direction);
141 switch(lane->direction)
144 msg.direction = adore_if_ros_msg::LaneChangeGeometry::LEFT;
147 msg.direction = adore_if_ros_msg::LaneChangeGeometry::RIGHT;
150 throw std::logic_error(
"Undefine value for direction in LaneChangeGeometry msg");
152 copyto(msg.targetOuterBorderDistance,lane->targetOuterBorderDistance_fct);
153 copyto(msg.separatingBorderDistance,lane->separatingBorderDistance_fct);
154 copyto(msg.sourceOuterBorderDistance,lane->sourceOuterBorderDistance_fct);
162 lpf.
getData().set_size(4, msg->s.size());
163 for (std::size_t counter = 0; counter < msg->s.size(); counter++)
165 lpf.
getData()(0, counter) = msg->s[counter];
166 lpf.
getData()(1, counter) = msg->x[counter];
167 lpf.
getData()(2, counter) = msg->y[counter];
168 lpf.
getData()(3, counter) = msg->z[counter];
177 adore_if_ros_msg::LinearPiecewiseFunction3d msg;
178 for (std::size_t counter = 0; counter < lpf.
getData().nc(); counter++)
180 msg.s.push_back(lpf.
getData()(0, counter));
181 msg.x.push_back(lpf.
getData()(1, counter));
182 msg.y.push_back(lpf.
getData()(2, counter));
183 msg.z.push_back(lpf.
getData()(3, counter));
196 lpf.
getData().set_size(4, msg.s.size());
197 for (std::size_t counter = 0; counter < msg.s.size(); counter++)
199 lpf.
getData()(0, counter) = msg.s[counter];
200 lpf.
getData()(1, counter) = msg.x[counter];
201 lpf.
getData()(2, counter) = msg.y[counter];
202 lpf.
getData()(3, counter) = msg.z[counter];
218 for (std::size_t counter = 0; counter < lpf.
getData().nc(); counter++)
220 msg.s.push_back(lpf.
getData()(0, counter));
221 msg.x.push_back(lpf.
getData()(1, counter));
222 msg.y.push_back(lpf.
getData()(2, counter));
223 msg.z.push_back(lpf.
getData()(3, counter));
235 lpf.
getData().set_size(2, msg.s.size());
236 for (std::size_t counter = 0; counter < msg.s.size(); counter++)
238 lpf.
getData()(0, counter) = msg.s[counter];
239 lpf.
getData()(1, counter) = msg.x[counter];
253 for (std::size_t counter = 0; counter < lpf.
getData().nc(); counter++)
255 msg.s.push_back(lpf.
getData()(0, counter));
256 msg.x.push_back(lpf.
getData()(1, counter));
268 lpf.
getData().set_size(3, msg.s.size());
269 for (std::size_t counter = 0; counter < msg.s.size(); counter++)
271 lpf.
getData()(0, counter) = msg.s[counter];
272 lpf.
getData()(1, counter) = msg.x[counter];
273 lpf.
getData()(2, counter) = msg.y[counter];
288 for (std::size_t counter = 0; counter < lpf.
getData().nc(); counter++)
290 msg.s.push_back(lpf.
getData()(0, counter));
291 msg.x.push_back(lpf.
getData()(1, counter));
292 msg.y.push_back(lpf.
getData()(2, counter));
adoreMatrix< T, n+1, 0 > & getData()
Definition: llinearpiecewisefunction.h:147
@ LEFT
Definition: alanechangeview.h:43
@ RIGHT
Definition: alanechangeview.h:43
Definition: areaofeffectconverter.h:20
Definition: lanecombinedgeometry.h:27
std::shared_ptr< LaneGeometryDataProxy > center
Definition: lanecombinedgeometry.h:29
std::shared_ptr< LaneChangeDataProxy > rightChange
Definition: lanecombinedgeometry.h:35
std::shared_ptr< LaneChangeDataProxy > leftChange
Definition: lanecombinedgeometry.h:33
std::shared_ptr< LaneGeometryDataProxy > right
Definition: lanecombinedgeometry.h:34
std::shared_ptr< LaneGeometryDataProxy > left
Definition: lanecombinedgeometry.h:30
Definition: lanegeometryconverter.h:32
adore_if_ros_msg::LaneGeometry operator()(const adore::env::BorderBased::CombinedLaneGeometry &combined)
Definition: lanegeometryconverter.h:98
adore_if_ros_msg::LinearPiecewiseFunction3d operator()(const adore::mad::function_type_xyz &lpf)
Definition: lanegeometryconverter.h:175
void copyto(adore_if_ros_msg::LinearPiecewiseFunction2d &msg, adore::mad::function_type2d const &lpf)
copy of lpf function type scalar to adore_if_ros_msg::LinearPieceWiseFunction1d
Definition: lanegeometryconverter.h:283
void copyto(adore::mad::function_type2d &lpf, adore_if_ros_msg::LinearPiecewiseFunction2d const &msg)
copy of adore_if_ros_msg::LinearPieceWiseFunction1d to lpf function type scalar
Definition: lanegeometryconverter.h:266
void copyLaneChangefromMsg(std::shared_ptr< adore::env::BorderBased::LaneChangeDataProxy > lane, adore_if_ros_msg::LaneChangeGeometry const &msg)
Definition: lanegeometryconverter.h:72
void copyto(adore_if_ros_msg::LinearPiecewiseFunction3d &msg, adore::mad::function_type_xyz const &lpf)
copy of lpf function type xyz to adore_if_ros_msg::LinearPieceWiseFunction3d
Definition: lanegeometryconverter.h:212
void operator()(adore_if_ros_msg::LaneGeometryConstPtr msg, adore::env::BorderBased::CombinedLaneGeometry &combined)
Definition: lanegeometryconverter.h:37
void copyto(adore::mad::function_type_xyz &lpf, adore_if_ros_msg::LinearPiecewiseFunction3d const &msg)
copy of adore_if_ros_msg::LinearPieceWiseFunction3d to lpf function type xyz
Definition: lanegeometryconverter.h:194
void copyMsgfromLaneChange(adore_if_ros_msg::LaneChangeGeometry &msg, std::shared_ptr< adore::env::BorderBased::LaneChangeDataProxy > lane)
Definition: lanegeometryconverter.h:134
void copyto(adore::mad::function_type_scalar &lpf, adore_if_ros_msg::LinearPiecewiseFunction1d const &msg)
copy of adore_if_ros_msg::LinearPieceWiseFunction1d to lpf function type scalar
Definition: lanegeometryconverter.h:233
void copyto(adore_if_ros_msg::LinearPiecewiseFunction1d &msg, adore::mad::function_type_scalar const &lpf)
copy of lpf function type scalar to adore_if_ros_msg::LinearPieceWiseFunction1d
Definition: lanegeometryconverter.h:249
void copyMsgfromLane(adore_if_ros_msg::LaneFollowingGeometry &msg, std::shared_ptr< adore::env::BorderBased::LaneGeometryDataProxy > lane)
Definition: lanegeometryconverter.h:118
void copyLanefromMsg(std::shared_ptr< adore::env::BorderBased::LaneGeometryDataProxy > lane, adore_if_ros_msg::LaneFollowingGeometry const &msg)
Definition: lanegeometryconverter.h:56
void operator()(adore_if_ros_msg::LinearPiecewiseFunction3dConstPtr msg, adore::mad::function_type_xyz &lpf)
Definition: lanegeometryconverter.h:160