Skip to content

Commit

Permalink
Fix #3
Browse files Browse the repository at this point in the history
  • Loading branch information
szepilot committed May 12, 2023
1 parent 470e1d6 commit 7232176
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/multiple_goal_pursuit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class MultipleGoalPursuit : public rclcpp::Node
if (param.get_name() == "waypoint_topic")
{
waypoint_topic = param.as_string();
sub_w_ = this->create_subscription<geometry_msgs::msg::PoseArray>(waypoint_topic, 10, std::bind(&SingleGoalPursuit::waypointCallback, this, _1));
sub_w_ = this->create_subscription<geometry_msgs::msg::PoseArray>(waypoint_topic, 10, std::bind(&MultipleGoalPursuit::waypointCallback, this, _1));
}
if (param.get_name() == "wheelbase")
{
Expand Down
1 change: 0 additions & 1 deletion src/single_goal_pursuit.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ class SingleGoalPursuit : public rclcpp::Node
float alpha = atan2(goal_y, goal_x);
float lookahead_distance = sqrt(pow(goal_x, 2) + pow(goal_y, 2));
float steering_angle = atan2(2.0 * wheelbase * sin(alpha) / (lookahead_distance), 1);
steering_angle *= 14.8; // TODO: move to driver, geometry_msgs/Twist.angular.z should be in radians/second
return steering_angle;
}

Expand Down
2 changes: 1 addition & 1 deletion src/stanley_control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class StanleyControl : public rclcpp::Node
if (param.get_name() == "waypoint_topic")
{
waypoint_topic = param.as_string();
sub_w_ = this->create_subscription<geometry_msgs::msg::PoseArray>(waypoint_topic, 10, std::bind(&SingleGoalPursuit::waypointCallback, this, _1));
sub_w_ = this->create_subscription<geometry_msgs::msg::PoseArray>(waypoint_topic, 10, std::bind(&StanleyControl::waypointCallback, this, _1));
}
if (param.get_name() == "wheelbase")
{
Expand Down

0 comments on commit 7232176

Please sign in to comment.