Tesseract 0.28.4
Loading...
Searching...
No Matches
collision.cpp File Reference

Parse collision from xml string. More...

#include <tesseract/common/macros.h>
#include <stdexcept>
#include <Eigen/Geometry>
#include <tesseract/common/utils.h>
#include <tinyxml2.h>
#include <tesseract/common/resource_locator.h>
#include <tesseract/scene_graph/link.h>
#include <tesseract/geometry/geometry.h>
#include <tesseract/urdf/collision.h>
#include <tesseract/urdf/geometry.h>
#include <tesseract/urdf/origin.h>

Functions

std::shared_ptr< tesseract::scene_graph::Collisiontesseract::urdf::parseCollision (const tinyxml2::XMLElement *xml_element, const tesseract::common::ResourceLocator &locator, bool make_convex_meshes)
 Parse xml element collision.
 
tinyxml2::XMLElement * tesseract::urdf::writeCollision (const std::shared_ptr< const tesseract::scene_graph::Collision > &collision, tinyxml2::XMLDocument &doc, const std::string &package_path, const std::string &link_name, int id)
 writeCollision Write collision object to URDF XML
 

Detailed Description

Parse collision from xml string.

Author
Levi Armstrong
Date
September 1, 2019
License
Software License Agreement (Apache License)
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ parseCollision()

tesseract::scene_graph::Collision::Ptr tesseract::urdf::parseCollision ( const tinyxml2::XMLElement *  xml_element,
const tesseract::common::ResourceLocator locator,
bool  make_convex_meshes 
)

Parse xml element collision.

Parameters
xml_elementThe xml element
locatorThe Tesseract resource locator
make_convex_meshesFlag to indicate if the meshes should be converted to convex hulls
Returns
A Collision object

◆ writeCollision()

tinyxml2::XMLElement * tesseract::urdf::writeCollision ( const std::shared_ptr< const tesseract::scene_graph::Collision > &  collision,
tinyxml2::XMLDocument &  doc,
const std::string &  package_path,
const std::string &  link_name,
int  id = -1 
)

writeCollision Write collision object to URDF XML

Parameters
collisionCollision object to be written
docXML Document to which XML will belong
package_path/<path>/<to>/<your-package>. If set, geometry will be saved relative to the package. If not set, geometry will be saved with absolute paths.
link_nameName of link to which collision object is attached
idIf set, this ID will be appended to the geometry name for saving to distinguish between multiple collision geometries on the same link.
Returns
An XML element representing the collision object in URDF format.