astar_search.cpp !first i launch the astar_navi,then,it do not work!then,i found the error in the astar_search.cpp file.and i have test the code,the error happened at the detectCollision()function!

asked 2020-12-03 01:26:20 -0500

rosli gravatar image

bool AstarSearch::detectCollision(const SimpleNode& sn) { // Define the robot as rectangle static double left = -1.0 * robot_base2back_; static double right = robot_length_ - robot_base2back_; static double top = robot_width_ / 2.0; static double bottom = -1.0 * robot_width_ / 2.0; static double resolution = costmap_.info.resolution;

// Coordinate of base_link in OccupancyGrid frame static double one_angle_range = 2.0 * M_PI / theta_size_; double base_x = sn.index_x * resolution; double base_y = sn.index_y * resolution; double base_theta = sn.index_theta * one_angle_range;

// Calculate cos and sin in advance double cos_theta = std::cos(base_theta); double sin_theta = std::sin(base_theta);

// Convert each point to index and check if the node is Obstacle for (double x = left; x < right; x += resolution) { for (double y = top; y > bottom; y -= resolution) { // 2D point rotation int index_x = (x * cos_theta - y * sin_theta + base_x) / resolution; int index_y = (x * sin_theta + y * cos_theta + base_y) / resolution;

  if (isOutOfRange(index_x, index_y))
  {
    return true;
  }
  else if (nodes_[index_y][index_x][0].status == STATUS::OBS)
  {
    return true;
  }
}

}

return false; }

this is the function!anyone can tell me why it could detect the collision!!!!!!!!!

edit retag flag offensive close merge delete

Comments

I'm sorry but I do not understnad your question. Please provide the following information:

  • Operating System
  • Version of Autoware.AI being used
  • Description of the problem including what nodes were being used and what conditions caused the problem to occur

A ROSBAG of the problem would also be helpful.

Josh Whitley gravatar image Josh Whitley  ( 2020-12-03 11:30:39 -0500 )edit

1.ubunt 18.04 2.version 1.11.0 3.node included:TF/point Cloud/baselink to localizer/voxel_grid_filter/ndt_matching/costmap_generator/astar_navi 4.then i use 2D Nav Goal in the rviz,then,it show nothing in the rviz,and show the warn

rosli gravatar image rosli  ( 2020-12-03 19:00:09 -0500 )edit