Skip to content

Commit

Permalink
fix and close issue ai-winter#46
Browse files Browse the repository at this point in the history
  • Loading branch information
ai-winter committed Jan 27, 2024
1 parent eb641eb commit bd6be12
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 7 deletions.
2 changes: 0 additions & 2 deletions src/core/local_planner/local_planner/src/local_planner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -337,8 +337,6 @@ void LocalPlanner::getLookAheadPoint(double lookahead_dist, geometry_msgs::PoseS
double py = prev_pose_it->pose.position.y;
double gx = goal_pose_it->pose.position.x;
double gy = goal_pose_it->pose.position.y;
double ppx = pprev_pose_it->pose.position.x;
double ppy = pprev_pose_it->pose.position.y;

// transform to the robot frame so that the circle centers at (0,0)
std::pair<double, double> prev_p(px - rx, py - ry);
Expand Down
1 change: 1 addition & 0 deletions src/core/utils/include/math_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ double dist(const geometry_msgs::PoseStamped& node1, const geometry_msgs::PoseSt
*/
double angle(const Node& node1, const Node& node2);
double angle(const std::pair<double, double>& node1, const std::pair<double, double>& node2);
double angle(const geometry_msgs::PoseStamped& node1, const geometry_msgs::PoseStamped& node2);

/**
* @brief Perform modulus operation on 2π.
Expand Down
8 changes: 6 additions & 2 deletions src/core/utils/src/math_helper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
* @date: 2024-01-03
* @version: 1.2
*
* Copyright (c) 2024, Yang Haodong.
* Copyright (c) 2024, Yang Haodong.
* All rights reserved.
*
*
* --------------------------------------------------------
*
* ********************************************************
Expand Down Expand Up @@ -60,6 +60,10 @@ double angle(const std::pair<double, double>& node1, const std::pair<double, dou
return atan2(node2.second - node1.second, node2.first - node1.first);
}

double angle(const geometry_msgs::PoseStamped& node1, const geometry_msgs::PoseStamped& node2)
{
return atan2(node2.pose.position.y - node1.pose.position.y, node2.pose.position.x - node1.pose.position.x);
}
/**
* @brief Perform modulus operation on 2π.
* @param theta the angle to modulu
Expand Down
2 changes: 0 additions & 2 deletions src/sim_env/config/costmap/global_costmap_params.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ global_costmap:
publish_frequency: 1.0
transform_tolerance: 0.5

static_map: true

inflation_radius: 1.0

### Sensor management parameters ###
Expand Down
2 changes: 1 addition & 1 deletion src/sim_env/launch/include/robots/start_robots.launch.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<launch>
<arg name="robot_number" default="1" />
<arg name="robot1_type" value="turtlebot3_waffle" />
<arg name="robot1_global_planner" value="a_star" />
<arg name="robot1_global_planner" value="lpa_star" />
<arg name="robot1_local_planner" value="pid" />
<arg name="robot1_x_pos" value="0.0" />
<arg name="robot1_y_pos" value="0.0" />
Expand Down
1 change: 1 addition & 0 deletions src/sim_env/launch/main.launch
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<launch>
<arg name="world_parameter" value="warehouse" />
<node pkg="dynamic_xml_config" type="obstacles_generate_ros.py" name="obstacles_generate" args="user_config.yaml" output="screen" />
<include file="$(find sim_env)/launch/config.launch">
<arg name="world" value="$(arg world_parameter)" />
<arg name="map" value="warehouse" />
Expand Down

0 comments on commit bd6be12

Please sign in to comment.