We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
你好,我运行了你的check_collision.cpp的代码,我可以做到自身碰撞的检测。 但是我无法做到碰撞到障碍物的检测:在旁边增加一个书柜,让机械臂planning去碰撞那个书柜,我使用带参数的rosservice call规划去碰撞书柜,但是并不会返回碰撞到。请问是这个check_collision.cpp本来就没有检测和其他物体的碰撞吗
请问如果我需要做什么才能改成能够检测障碍物,我参考了古月的代码进行修改,但是没有任何帮助。我的修改如下: bool CheckCollisionNode::CheckCollision(vector<double>& values) { RobotState& robot_state = this->m_planScene->getCurrentStateNonConst(); collision_detection::AllowedCollisionMatrix acm = this->m_planScene->getAllowedCollisionMatrixNonConst(); robot_state::RobotState copied_state = this->m_planScene->getCurrentState(); collision_detection::CollisionResult::ContactMap::const_iterator it2; int k=0; for(it2=this->m_collResult.contacts.begin(); it2!=this->m_collResult.contacts.end(); ++it2,k++){ acm.setEntry(it2->first.first,it2->first.second,true); } // format Float64MultiArray to vector<double> printf("\nhere is the %d joint state:\n",k); for (int i = 0; i < this->m_jointNames.size(); i++) { this->m_jointValues[i] = values[i]; robot_state.setJointPositions(this->m_jointNames[i], &this->m_jointValues[i]); printf("\t%f\n",this->m_jointValues[i]); } // check m_collResult.clear();//Self m_planScene->checkCollision(this->m_collRequest, this->m_collResult, copied_state, acm); return this->m_collResult.collision; }
bool CheckCollisionNode::CheckCollision(vector<double>& values) { RobotState& robot_state = this->m_planScene->getCurrentStateNonConst(); collision_detection::AllowedCollisionMatrix acm = this->m_planScene->getAllowedCollisionMatrixNonConst(); robot_state::RobotState copied_state = this->m_planScene->getCurrentState(); collision_detection::CollisionResult::ContactMap::const_iterator it2; int k=0; for(it2=this->m_collResult.contacts.begin(); it2!=this->m_collResult.contacts.end(); ++it2,k++){ acm.setEntry(it2->first.first,it2->first.second,true); } // format Float64MultiArray to vector<double> printf("\nhere is the %d joint state:\n",k); for (int i = 0; i < this->m_jointNames.size(); i++) { this->m_jointValues[i] = values[i]; robot_state.setJointPositions(this->m_jointNames[i], &this->m_jointValues[i]); printf("\t%f\n",this->m_jointValues[i]); } // check m_collResult.clear();//Self m_planScene->checkCollision(this->m_collRequest, this->m_collResult, copied_state, acm); return this->m_collResult.collision; }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
你好,我运行了你的check_collision.cpp的代码,我可以做到自身碰撞的检测。
但是我无法做到碰撞到障碍物的检测:在旁边增加一个书柜,让机械臂planning去碰撞那个书柜,我使用带参数的rosservice call规划去碰撞书柜,但是并不会返回碰撞到。请问是这个check_collision.cpp本来就没有检测和其他物体的碰撞吗
请问如果我需要做什么才能改成能够检测障碍物,我参考了古月的代码进行修改,但是没有任何帮助。我的修改如下:
bool CheckCollisionNode::CheckCollision(vector<double>& values) { RobotState& robot_state = this->m_planScene->getCurrentStateNonConst(); collision_detection::AllowedCollisionMatrix acm = this->m_planScene->getAllowedCollisionMatrixNonConst(); robot_state::RobotState copied_state = this->m_planScene->getCurrentState(); collision_detection::CollisionResult::ContactMap::const_iterator it2; int k=0; for(it2=this->m_collResult.contacts.begin(); it2!=this->m_collResult.contacts.end(); ++it2,k++){ acm.setEntry(it2->first.first,it2->first.second,true); } // format Float64MultiArray to vector<double> printf("\nhere is the %d joint state:\n",k); for (int i = 0; i < this->m_jointNames.size(); i++) { this->m_jointValues[i] = values[i]; robot_state.setJointPositions(this->m_jointNames[i], &this->m_jointValues[i]); printf("\t%f\n",this->m_jointValues[i]); } // check m_collResult.clear();//Self m_planScene->checkCollision(this->m_collRequest, this->m_collResult, copied_state, acm); return this->m_collResult.collision; }
The text was updated successfully, but these errors were encountered: