Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update functions of removing specified obstacles and clearing obstacles #3

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/RVOSimulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,16 @@ namespace RVO {
return obstacleNo;
}

void RVOSimulator::clearObstacle()
{
obstacles_.clear();
}

void RVOSimulator::removeObstacle(size_t ObstacleNo)
{
obstacles_.erase(obstacles_.begin() + ObstacleNo);
}

void RVOSimulator::doStep()
{
kdTree_->buildAgentTree();
Expand Down
12 changes: 12 additions & 0 deletions src/RVOSimulator.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,18 @@ namespace RVO {
*/
size_t addObstacle(const std::vector<Vector2> &vertices);

/**
* \brief Clear all the obstacles .
*/
void clearObstacle();

/**
* \brief Remove a specified obstacle.
* \param agentNo The number of the agent who want to remove.
*/
void removeObstacle(size_t ObstacleNo);


/**
* \brief Lets the simulator perform a simulation step and updates the
* two-dimensional position and two-dimensional velocity of
Expand Down