1010PipelineFollowerNode::PipelineFollowerNode ()
1111: Node(" pipeline_follower_node" )
1212{
13- input_topic_lines_ = this ->declare_parameter <std::string>(" input_topic_lines" , " irls_line/lines" );
14- input_topic_info_ = this ->declare_parameter <std::string>(" input_topic_info" , " /pipeline/camera/camera_info" );
15- input_topic_pose_ = this ->declare_parameter <std::string>(" input_topic_pose" , " /orca/odom" );
16- input_topic_altitude_ = this ->declare_parameter <std::string>(" input_topic_altitude" , " /orca/dvl/altitude" );
17- camera_height_ = this ->declare_parameter <double >(" camera_height" , 0.5 );
18- send_rate_hz_ = this ->declare_parameter <double >(" send_rate_hz" , 0.90 );
19- camera_placment_x_ = this ->declare_parameter <double >(" camera_placment_x" , 0.4 );
13+ input_topic_lines_ = this ->declare_parameter <std::string>(" input_topic_lines" );
14+ input_topic_info_ = this ->declare_parameter <std::string>(" input_topic_info" );
15+ input_topic_pose_ = this ->declare_parameter <std::string>(" input_topic_pose" );
16+ input_topic_altitude_ = this ->declare_parameter <std::string>(" input_topic_altitude" );
17+ camera_height_ = this ->declare_parameter <double >(" camera_height" );
18+ send_rate_hz_ = this ->declare_parameter <double >(" send_rate_hz" );
19+ camera_placment_x_ = this ->declare_parameter <double >(" camera_placment_x" );
20+ camera_placment_y_ = this ->declare_parameter <double >(" camera_placment_y" );
21+ camera_placment_z_ = this ->declare_parameter <double >(" camera_placment_z" );
22+ target_height_ = this ->declare_parameter <double >(" target_height" );
2023
2124 debug_waypoint_topic_ = this ->declare_parameter <std::string>(" debug_waypoint_topic" , " /debug/waypoint" );
2225 debug_service_off_topic_ = this ->declare_parameter <std::string>(" debug_service_off_topic" , " /debug/send_waypoints_service_off" );
@@ -48,7 +51,7 @@ PipelineFollowerNode::PipelineFollowerNode()
4851 std::bind (&PipelineFollowerNode::infoCb, this , std::placeholders::_1)
4952 );
5053
51- client_ = this ->create_client <vortex_msgs::srv::SendWaypoints>(" /orca /waypoint_addition" );
54+ client_ = this ->create_client <vortex_msgs::srv::SendWaypoints>(" /nautilus /waypoint_addition" );
5255
5356 goal_service_ = this ->create_service <std_srvs::srv::Trigger>(
5457 " pipline/goal_service" ,
@@ -144,7 +147,7 @@ void PipelineFollowerNode::sendOrDebugWaypoint(
144147 bool overwrite_prior, bool take_priority,
145148 uint mode, double switching_threshold)
146149{
147- constexpr double MIN_WP_DIST = 0.15 ;
150+ constexpr double MIN_WP_DIST = 0.20 ;
148151
149152 if (have_prev_wp_) {
150153 const double dx = x - prev_x_;
@@ -174,7 +177,7 @@ void PipelineFollowerNode::sendOrDebugWaypoint(
174177 wp.pose .position .y = y;
175178 wp.pose .position .z = z;
176179 wp.pose .orientation = quatFromYaw (yaw);
177- wp.mode = mode;
180+ wp.waypoint_mode . mode = mode;
178181
179182 if (!client_->service_is_ready ()) {
180183 debug_wp_pub_->publish (wp);
@@ -272,8 +275,8 @@ void PipelineFollowerNode::handleSingleLine(const vortex_msgs::msg::LineSegment2
272275 double forward = ground.y ;
273276
274277 auto [dx, dy] = rotateXY (forward, right, robot_yaw_);
275- auto [xc, yc] = rotateXY (camera_placment_x_, 0 , robot_yaw_);
276- auto new_robot_z = hight_regulator (robot_a_, robot_z_);
278+ auto [xc, yc] = rotateXY (camera_placment_x_, camera_placment_y_ , robot_yaw_);
279+ auto new_robot_z = hight_regulator (robot_a_, robot_z_, target_height_ );
277280
278281 double x_in_meters = robot_x_ + dx + xc;
279282 double y_in_meters = robot_y_ + dy + yc;
@@ -282,14 +285,14 @@ void PipelineFollowerNode::handleSingleLine(const vortex_msgs::msg::LineSegment2
282285 double newYaw = angleBetweenLinesRad (robot_yaw_, p1, p2, cv::Point2f (0 , 0 ), cv::Point2f (1 , 1 ), true );
283286 if (abs (abs (robot_yaw_) - abs (newYaw)) > 1.35 ) {
284287 sendOrDebugWaypoint (x_in_meters, y_in_meters, new_robot_z, robot_yaw_,
285- true , false , vortex_msgs::msg::Waypoint ::FORWARD_HEADING , 0.3 );
288+ true , false , vortex_msgs::msg::WaypointMode ::FORWARD_HEADING , 0.3 );
286289 return ;
287290 }
288291 sendOrDebugWaypoint (robot_x_, robot_y_, new_robot_z, newYaw,
289- true , false , vortex_msgs::msg::Waypoint ::ONLY_ORIENTATION , 0.3 );
292+ true , false , vortex_msgs::msg::WaypointMode ::ONLY_ORIENTATION , 0.3 );
290293 } else {
291294 sendOrDebugWaypoint (x_in_meters, y_in_meters, new_robot_z, robot_yaw_,
292- true , false , vortex_msgs::msg::Waypoint ::FORWARD_HEADING , 0.3 );
295+ true , false , vortex_msgs::msg::WaypointMode ::FORWARD_HEADING , 0.3 );
293296 }
294297}
295298
@@ -329,7 +332,7 @@ void PipelineFollowerNode::handleTwoLines(
329332 double forward = ground.y ;
330333
331334 auto [dx, dy] = rotateXY (forward, right, robot_yaw_);
332- auto [xc, yc] = rotateXY (camera_placment_x_, 0 , robot_yaw_);
335+ auto [xc, yc] = rotateXY (camera_placment_x_, camera_placment_y_ , robot_yaw_);
333336
334337 double x_in_meters = robot_x_ + dx + xc;
335338 double y_in_meters = robot_y_ + dy + yc;
@@ -343,7 +346,7 @@ void PipelineFollowerNode::handleTwoLines(
343346 last_corner_x_ = x_in_meters;
344347 last_corner_y_ = y_in_meters;
345348 have_last_corner_ = true ;
346- auto new_robot_z = hight_regulator (robot_a_, robot_z_);
349+ auto new_robot_z = hight_regulator (robot_a_, robot_z_, target_height_ );
347350
348351 double angle_rad = angleBetweenLinesRad (robot_yaw_, p1, p2, q1, q2);
349352 double yaw_rad = angle_rad;
@@ -353,14 +356,14 @@ void PipelineFollowerNode::handleTwoLines(
353356 wp1.pose .position .y = y_in_meters;
354357 wp1.pose .position .z = new_robot_z;
355358 wp1.pose .orientation = quatFromYaw (robot_yaw_);
356- wp1.mode = vortex_msgs::msg::Waypoint ::FULL_POSE ;
359+ wp1.waypoint_mode . mode = vortex_msgs::msg::WaypointMode ::FULL_POSE ;
357360
358361 vortex_msgs::msg::Waypoint wp2;
359362 wp2.pose .position .x = x_in_meters;
360363 wp2.pose .position .y = y_in_meters;
361364 wp2.pose .position .z = new_robot_z;
362365 wp2.pose .orientation = quatFromYaw (yaw_rad);
363- wp2.mode = vortex_msgs::msg::Waypoint ::FULL_POSE ;
366+ wp2.waypoint_mode . mode = vortex_msgs::msg::WaypointMode ::FULL_POSE ;
364367
365368 double xf = x_in_meters + 0.5 * std::cos (yaw_rad);
366369 double yf = y_in_meters + 0.5 * std::sin (yaw_rad);
@@ -370,7 +373,7 @@ void PipelineFollowerNode::handleTwoLines(
370373 wp3.pose .position .y = yf;
371374 wp3.pose .position .z = new_robot_z;
372375 wp3.pose .orientation = quatFromYaw (yaw_rad);
373- wp3.mode = vortex_msgs::msg::Waypoint ::FULL_POSE ;
376+ wp3.waypoint_mode . mode = vortex_msgs::msg::WaypointMode ::FULL_POSE ;
374377
375378 enqueueWaypoint (wp1, true , true , 0.1 );
376379 enqueueWaypoint (wp2, false , true , 0.1 );
0 commit comments