|
ed
|
Classes | |
| class | ModelLoader |
Enumerations | |
| enum | LoadType { FILE, MODEL } |
| The LoadType enum indicates whether to load directly from a file or from a model that is part of the ED_MODEL_PATH. More... | |
| enum | ModelOrFile { MODEL, MODEL, FILE, FILE } |
| The ModelOrFile enum This is used to determine the URI type in SDF. More... | |
Functions | |
| void | createCylinder (geo::Shape &shape, double radius, double height, int num_corners=12) |
| createCylinder create a mesh from radius and height More... | |
| void | createPolygon (geo::Shape &shape, const std::vector< geo::Vec2 > &points, double height, std::stringstream &error, bool create_bottom=true) |
| createPolygon create polygon mesh from points More... | |
| void | createSphere (geo::Shape &shape, double radius, uint recursion_level=2) |
| createSphere Create a shape of sphere More... | |
| void | findContours (const cv::Mat &image, const geo::Vec2i &p_start, int d_start, std::vector< geo::Vec2i > &points, std::vector< geo::Vec2i > &line_starts, cv::Mat &contour_map) |
| findContours More... | |
| geo::ShapePtr | getHeightMapShape (const std::string &image_filename, const geo::Vec3 &pos, const double blockheight, const double resolution_x, const double resolution_y, const bool inverted, std::stringstream &error) |
| getHeightMapShape convert grayscale image in a heigtmap mesh More... | |
| geo::ShapePtr | getHeightMapShape (const std::string &image_filename, const geo::Vec3 &pos, const geo::Vec3 &size, const bool inverted, std::stringstream &error) |
| getHeightMapShape convert grayscale image in a heigtmap mesh More... | |
| geo::ShapePtr | getHeightMapShape (const std::string &image_filename, tue::config::Reader cfg, std::stringstream &error) |
| getHeightMapShape convert grayscale image in a heigtmap mesh More... | |
| geo::ShapePtr | getHeightMapShape (cv::Mat &image_orig, const geo::Vec3 &pos, const geo::Vec3 &size, const bool inverted, std::stringstream &error) |
| getHeightMapShape convert grayscale image in a heigtmap mesh More... | |
| uint | getMiddlePoint (geo::Mesh &mesh, uint i1, uint i2, std::map< unsigned long, uint > cache, double radius) |
| getMiddlePoint Gets the middle point of two points in a mesh of a sphere. Uses a cache to not create double points. The new point is placed on the radius of the sphere. More... | |
| static std::string | getUriPath (std::string type) |
| getUriPath searches GAZEBO_MODEL_PATH and GAZEBO_RESOURCH_PATH for file More... | |
| bool | loadModel (const LoadType load_type, const std::string &source, ed::UpdateRequest &req) |
| loadModel loads an ED model from file More... | |
| geo::ShapePtr | loadShape (const std::string &model_path, tue::config::Reader cfg, std::map< std::string, geo::ShapePtr > &shape_cache, std::stringstream &error) |
| loadShape load the shape of a model. More... | |
| std::string | parseURI (const std::string &uri, ModelOrFile &uri_type) |
| bool | readPose (tue::config::Reader &cfg, geo::Pose3D &pose, tue::config::RequiredOrOptional pos_req=tue::config::REQUIRED, tue::config::RequiredOrOptional rot_req=tue::config::OPTIONAL) |
| readPose read pose into Pose3D. Both ED yaml and SDF. Also reads pos(position) of SDF. More... | |
| bool | readSDFGeometry (tue::config::Reader r, geo::CompositeShapePtr &composite, std::stringstream &error, geo::Pose3D pose_offset=geo::Pose3D::identity()) |
| void | readVec3 (tue::config::Reader &cfg, geo::Vec3 &v, tue::config::RequiredOrOptional pos_req=tue::config::REQUIRED) |
| readVec3 read x, y and z into a vector More... | |
| bool | readVec3Group (tue::config::Reader &cfg, geo::Vec3 &v, const std::string &vector_name, tue::config::RequiredOrOptional=tue::config::REQUIRED) |
| readVec3Group read a config group into a Vec3 More... | |
| std::vector< std::string > | split (const std::string &strToSplit, char delimeter) |
| split Implementation by using delimiter as a character. Multiple delimeters are removed. More... | |
|
strong |
The LoadType enum indicates whether to load directly from a file or from a model that is part of the ED_MODEL_PATH.
| Enumerator | |
|---|---|
| FILE | |
| MODEL | |
Definition at line 148 of file model_loader.h.
The ModelOrFile enum This is used to determine the URI type in SDF.
| Enumerator | |
|---|---|
| MODEL | |
| MODEL | |
| FILE | |
| FILE | |
Definition at line 25 of file shape_loader_private.h.
| void ed::models::createCylinder | ( | geo::Shape & | shape, |
| double | radius, | ||
| double | height, | ||
| int | num_corners = 12 |
||
| ) |
createCylinder create a mesh from radius and height
| shape | filled mesh |
| radius | radius of the cylinder |
| height | height of the cylinder |
| num_corners | divided the circumference in N points and N+1 lines |
Definition at line 884 of file shape_loader.cpp.
| void ed::models::createPolygon | ( | geo::Shape & | shape, |
| const std::vector< geo::Vec2 > & | points, | ||
| double | height, | ||
| std::stringstream & | error, | ||
| bool | create_bottom = true |
||
| ) |
createPolygon create polygon mesh from points
| shape | filled mesh |
| points | 2D points which define the mesh |
| height | height of the mesh |
| error | error stream |
| create_bottom | false: open bottom; true: closed bottom |
Definition at line 451 of file shape_loader.cpp.
| void ed::models::createSphere | ( | geo::Shape & | shape, |
| double | radius, | ||
| uint | recursion_level = 2 |
||
| ) |
createSphere Create a shape of sphere
| shape | Shape object to be filled |
| radius | radius of the sphere |
| recursion_level | number of recursions to smooth the mesh, but rapidly increases the mesh. |
Definition at line 953 of file shape_loader.cpp.
| void ed::models::findContours | ( | const cv::Mat & | image, |
| const geo::Vec2i & | p_start, | ||
| int | d_start, | ||
| std::vector< geo::Vec2i > & | points, | ||
| std::vector< geo::Vec2i > & | line_starts, | ||
| cv::Mat & | contour_map | ||
| ) |
findContours
| image | Grayscale image |
| p_start | starting point |
| d_start | starting direction |
| points | |
| line_starts | |
| contour_map |
Definition at line 143 of file shape_loader.cpp.
| geo::ShapePtr ed::models::getHeightMapShape | ( | const std::string & | image_filename, |
| const geo::Vec3 & | pos, | ||
| const double | blockheight, | ||
| const double | resolution_x, | ||
| const double | resolution_y, | ||
| const bool | inverted, | ||
| std::stringstream & | error | ||
| ) |
getHeightMapShape convert grayscale image in a heigtmap mesh
| image_filename | full path of grayscale image |
| pos | position of the origin of the heigtmap |
| blockheight | height of the heightmap of max grayscale value |
| resolution_x | resolution in x direction in meters |
| resolution_y | resolution in y direction in meters |
| inverted | false: CV/ROS standard (black = height); true: SDF/GAZEBO (White = height) |
| errorerrorstream |
Definition at line 400 of file shape_loader.cpp.
| geo::ShapePtr ed::models::getHeightMapShape | ( | const std::string & | image_filename, |
| const geo::Vec3 & | pos, | ||
| const geo::Vec3 & | size, | ||
| const bool | inverted, | ||
| std::stringstream & | error | ||
| ) |
getHeightMapShape convert grayscale image in a heigtmap mesh
| image_filename | full path of grayscale image |
| pos | position of the origin of the heigtmap |
| size | dimensions of the final mesh |
| inverted | false: CV/ROS standard (black = height); true: SDF/GAZEBO (White = height) |
| errorerrorstream |
Definition at line 383 of file shape_loader.cpp.
| geo::ShapePtr ed::models::getHeightMapShape | ( | const std::string & | image_filename, |
| tue::config::Reader | cfg, | ||
| std::stringstream & | error | ||
| ) |
getHeightMapShape convert grayscale image in a heigtmap mesh
| image_filename | image_filename full path of grayscale image |
| cfg | reader with model/shape information |
| error | errorstream |
Definition at line 428 of file shape_loader.cpp.
| geo::ShapePtr ed::models::getHeightMapShape | ( | cv::Mat & | image_orig, |
| const geo::Vec3 & | pos, | ||
| const geo::Vec3 & | size, | ||
| const bool | inverted, | ||
| std::stringstream & | error | ||
| ) |
getHeightMapShape convert grayscale image in a heigtmap mesh
| image_orig | grayscale image |
| pos | position of the origin of the heigtmap |
| size | dimensions of the final mesh |
| inverted | false: CV/ROS standard (black = height); true: SDF/GAZEBO (White = height) |
| error | errorstream |
Definition at line 213 of file shape_loader.cpp.
| uint ed::models::getMiddlePoint | ( | geo::Mesh & | mesh, |
| uint | i1, | ||
| uint | i2, | ||
| std::map< unsigned long, uint > | cache, | ||
| double | radius | ||
| ) |
getMiddlePoint Gets the middle point of two points in a mesh of a sphere. Uses a cache to not create double points. The new point is placed on the radius of the sphere.
| mesh | Mesh of the sphere |
| i1 | index of first point |
| i2 | index of second point |
| cache | cache of the middle points |
| radius | radius of teh sphere |
Definition at line 924 of file shape_loader.cpp.
|
static |
getUriPath searches GAZEBO_MODEL_PATH and GAZEBO_RESOURCH_PATH for file
| type | subpath+filename incl. extension |
Definition at line 78 of file shape_loader.cpp.
| bool ed::models::loadModel | ( | const LoadType | load_type, |
| const std::string & | source, | ||
| ed::UpdateRequest & | req | ||
| ) |
loadModel loads an ED model from file
| load_type | indicates whether the provided source is a filename or an identifier of a model in the ED_MODEL_PATH |
| source | source filename or entity type |
| req | update request that will be filled with the data from the model |
Definition at line 21 of file load_model.cpp.
| geo::ShapePtr ed::models::loadShape | ( | const std::string & | model_path, |
| tue::config::Reader | cfg, | ||
| std::map< std::string, geo::ShapePtr > & | shape_cache, | ||
| std::stringstream & | error | ||
| ) |
loadShape load the shape of a model.
| model_path | path of the model |
| cfg | reader |
| shape_cache | cache for complex models |
| error | errorstream |
Definition at line 621 of file shape_loader.cpp.
| std::string ed::models::parseURI | ( | const std::string & | uri, |
| ModelOrFile & | uri_type | ||
| ) |
Definition at line 48 of file shape_loader.cpp.
| bool ed::models::readPose | ( | tue::config::Reader & | cfg, |
| geo::Pose3D & | pose, | ||
| tue::config::RequiredOrOptional | pos_req = tue::config::REQUIRED, |
||
| tue::config::RequiredOrOptional | rot_req = tue::config::OPTIONAL |
||
| ) |
readPose read pose into Pose3D. Both ED yaml and SDF. Also reads pos(position) of SDF.
| cfg | reader |
| pose | filled Pose3D pose |
| pos_req | position RequiredOrOptional |
| rot_req | rotation RequiredOrOptional |
Definition at line 561 of file shape_loader.cpp.
| bool ed::models::readSDFGeometry | ( | tue::config::Reader | r, |
| geo::CompositeShapePtr & | composite, | ||
| std::stringstream & | error, | ||
| geo::Pose3D | pose_offset = geo::Pose3D::identity() |
||
| ) |
Definition at line 29 of file model_loader.cpp.
| void ed::models::readVec3 | ( | tue::config::Reader & | cfg, |
| geo::Vec3 & | v, | ||
| tue::config::RequiredOrOptional | pos_req = tue::config::REQUIRED |
||
| ) |
readVec3 read x, y and z into a vector
| cfg | reader |
| v | filled Vec3 vector |
| pos_req | RequiredOrOptional |
Definition at line 521 of file shape_loader.cpp.
| bool ed::models::readVec3Group | ( | tue::config::Reader & | cfg, |
| geo::Vec3 & | v, | ||
| const std::string & | vector_name, | ||
| tue::config::RequiredOrOptional | = tue::config::REQUIRED |
||
| ) |
readVec3Group read a config group into a Vec3
| cfg | reader |
| v | filled Vec3 vector |
| vector_name | name of the reader group to be read |
| pos_req | RequiredOrOptional |
Definition at line 538 of file shape_loader.cpp.
| std::vector< std::string > ed::models::split | ( | const std::string & | strToSplit, |
| char | delimeter | ||
| ) |
split Implementation by using delimiter as a character. Multiple delimeters are removed.
| strToSplit | input string, which is splitted |
| delimeter | char on which the string is split |
Definition at line 33 of file shape_loader.cpp.
1.8.17