Skip to content

Obstacle Avoidance? #368

Open
Open
@HangX-Ma

Description

@HangX-Ma

Hi, I want to realize the obstacle avoidance function for robot path planning. In the following codes I set a threshold for occupancy state . If getOccupancy() return a value larger than 0.5, this node will be regard as an obstacle.

bool GraphSearch::isOccupied(octomap::OcTreeNode* currNode, octomap::point3d &point) {
  return (currNode!=NULL && currNode->getOccupancy() > 0.5);
}

I also use treeNode->setLogOdds() function to update the node occupancy value. If the manipulator can not reach this node or it collides the obstacle at this node. [Note]: I use a planning algorithm similar to A-star, based on Node.

  auto reNode = tree->search(key);
  reNode->setLogOdds(tree->getClampingThresMaxLog());
  tree->updateInnerOccupancy();

However, the Rviz shows a wrong phenomenon. The first picture shows my initial planned path cross through the obstacle. So I check the all voxel and find where the planned path cross through is empty. Is that normal? If I use the Moveit embeded planner, it can plan a safe path for the manipulator. Can you help me to figure out why this happens? @ahornung
occupied voxel
all voxel

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions