filename.h File Reference

Introduction

Functions to deal with file names.

The main files used in the CuikSuite have the following extensions (the base name is the same for all of them and given by the problem name, i.e., for the FourBars problems we can have FourBars.world, FourBars.param, FourBars.joints, etc.):

  • .world Used for files describing mechanisms (links + joints) plus obstacles. Plannint tools directly operate on the world files but to use the position analysis tools we first generate equation files from world files using cuikequations. The type of equations obtained depend on the representation used. The most common representations are LINKS (described here) and JOINTS (similar to the widely-used DH formulation). The first one is redundant (it uses more variables than degrees of freedom) and the second is not.
  • .param File with the parameters. The default set of parameters is in share/CuikSuite/default.param Here you can find a description of the parameters.
  • .joints Initial and final configuration for path/motion planning. Also the initial point when defining an altas. This is used for non-redundant (e.g., REPRESENTATION = JOINTS) formulation. We can generate .joints files from .links using cuiklinks2joints. The inverse is obtained using cuikjoints2links. Joint values can be obtained interactively using cuikmove or the cuikexplore.
  • .links Initial and final configuration for path/motion planning. Also the initial point when defining an altas. This is used if the mechanisms is modelled using a redundant formulations (e.g., REPRESENTATION = LINKS). We typically do not use this file, but the equivalent .joint file.
  • .cuik Files including variables and equations. The solution set of a cuik file can be obtained using cuik. This will produce a .sol file.
  • _simp.cuik Files including variables and equations for simplified systems. Simplified systems are obtained from .cuik systems using cuiksimplify. The simplification mainly removes variables assigned to constant values and variables linearly related to other variables. We typically don't use simplified systems since the cuik applications automatically simplify the problem (i.e., the simplification is done silently on the background).
  • .sol Solution file resulting from cuik. These files include the solution set of a given system of equations in the form of boxes. Solution files can be represented graphicall using cuikplot3d
  • _path.sol Solution of a path planning process. It includes a sequence of configurations connecting the start and goal configurations defined in the corresponding .joints or .links files.
  • _traj.sol Solution of a motion plannig process. It includes a sequence of states, actions, and exectuion time for each action connecting the start and goal configurations defined in the corresponding .joints or .links files.
  • .atlas File including an atlas describing a manifold. An atlas can be represented graphicaly using cuikplotatlas
  • .rrt File with an RRT derived during path planning. An atlas can be represented graphicaly using cuikplotrrt
  • .arrt File with the AtlasRRT information. Basically the information to coordinate a RRT and an Atlas.
  • .gcl Files with 3D geometry to be displayed with Geomview. This files are obtained using, for instance, cuikplot3d, cuikplotatlas, or cuikplotrrt.
  • .pdb Typical extension of files prividing molecular information (Protein Daba Bank file format).
  • .atom User provided atom 3d positions. If available, these positions are used to overide those in the pdb files which are given with low accuracy.
  • .tens Tensegrity structures.
See also
filename.c Tfilename

Definition in file filename.h.

Data Structures

struct  Tfilename
 Data structure to hold the information about the name of a file. More...
 

Macros

#define CUIK_EXT   "cuik"
 File extension for equation files. More...
 
#define PDB_EXT   "pdb"
 Default file extension for bio-info files. More...
 
#define ATOM_EXT   "atoms"
 File extension for atom coordinates files. More...
 
#define RGROUPS_EXT   "rgroups"
 File extension for atom rigid groups. More...
 
#define OFF_EXT   "off"
 File extension for geomview OFF files. More...
 
#define SLAM_EXT   "slam"
 File extension for slam files. More...
 
#define CAD_EXT   "cad"
 File extension for CAD files. More...
 
#define URDF_EXT   "urdf"
 File extension for URDFs. More...
 
#define SDF_EXT   "sdf"
 File extension for SDFs. More...
 
#define PARAM_EXT   "param"
 File extension for parameter files. More...
 
#define SOL_EXT   "sol"
 File extension for solution files. More...
 
#define SOL_WITH_DUMMIES_EXT   "dsol"
 File extension for solution files with dummies. More...
 
#define AXES_EXT   "axes"
 File extension for the mechanism axes. More...
 
#define COST_EXT   "cost"
 File extension for arrays of costs. More...
 
#define ENERGY_EXT   "energy"
 File extension for arrays of energy. More...
 
#define WORLD_EXT   "world"
 File extension for problem files. More...
 
#define PLOT3D_EXT   "gcl"
 File extension for 3D plot files. More...
 
#define PLOT2D_EXT   "fig"
 File extension for 2D plot files. More...
 
#define LINKS_EXT   "links"
 File extension for files with samples represented by the link poses. More...
 
#define JOINTS_EXT   "joints"
 File extension for files with samples represented by the joint values. More...
 
#define STATE_EXT   "state"
 File extension for files storing the interval solver state. More...
 
#define ATLAS_EXT   "atlas"
 File extension for files storing atlas. More...
 
#define ATLAS_GRAPH_EXT   "agraph"
 File extension for files atlas graph information. More...
 
#define RRT_EXT   "rrt"
 File extension for files storing rrt's. More...
 
#define ATLAS_RRT_EXT   "arrt"
 File extension for files storing AtlasRTT's. More...
 
#define RES_EXT   "res"
 File extension for files storing residue indentifiers. More...
 
#define RIGID_EXT   "rigids"
 File extension for files storing rigid part of molecules. More...
 
#define HINGE_EXT   "hinges"
 File extension for files storing the hinges of a molecule. More...
 
#define TENSEGRITY_EXT   "tens"
 File extension for files describing tensegrities. More...
 
#define FORCES_EXT   "forces"
 File extension for files including forces. More...
 

Functions

void CreateFileName (char *path, char *name, char *suffix, char *ext, Tfilename *fn)
 Constructor. More...
 
char * GetFileFullName (Tfilename *fn)
 Gets the file full name (paht+name+extension). More...
 
char * GetFilePath (Tfilename *fn)
 Gets the file path. More...
 
char * GetFileBaseName (Tfilename *fn)
 Gets the file base name (paht+name) . More...
 
char * GetFileName (Tfilename *fn)
 Gets the file name. More...
 
char * GetFileExtension (Tfilename *fn)
 Gets the file extension. More...
 
void LinkFileNameWithExtension (char *fn1, char *ext, Tfilename *fn2)
 Creates a link to a given filename. More...
 
void DeleteFileName (Tfilename *fn)
 Destructor. More...
 

Macro Definition Documentation

◆ CUIK_EXT

#define CUIK_EXT   "cuik"

File extension for equation files.

Definition at line 88 of file filename.h.

◆ PDB_EXT

#define PDB_EXT   "pdb"

Default extension for bio-info files (files including information about molecules). The system is interfaced with OpenBabel and, thus, we can manipulate many different types of bio-info files. The particular type to read/write is deduced from the file extension. If not given, though, 'pdb' is used.

Definition at line 98 of file filename.h.

◆ ATOM_EXT

#define ATOM_EXT   "atoms"

File extension for files giving atom 3D coordinates. This files are used, if available, to overide the atom position form pdb files, that are typically given with low accuracy.

Definition at line 106 of file filename.h.

◆ RGROUPS_EXT

#define RGROUPS_EXT   "rgroups"

File extension for files giving rigid groups of atoms.

Definition at line 112 of file filename.h.

◆ OFF_EXT

#define OFF_EXT   "off"

File extension for geomview OFF files. They include a description 3D geometry in the form of vertices and faces.

Definition at line 119 of file filename.h.

◆ SLAM_EXT

#define SLAM_EXT   "slam"

File extension for slam files. They include a description of the trajectory of a robot in 2D and the landmarks it observes.

Not used yet.

Definition at line 128 of file filename.h.

◆ CAD_EXT

#define CAD_EXT   "cad"

File extension for CAD files. They include geometric constraints.

Not used yet.

Definition at line 136 of file filename.h.

◆ URDF_EXT

#define URDF_EXT   "urdf"

File extension for URDFs: universal robot description files.

Definition at line 142 of file filename.h.

◆ SDF_EXT

#define SDF_EXT   "sdf"

File extension for SDFs: Gazebo input files.

Definition at line 148 of file filename.h.

◆ PARAM_EXT

#define PARAM_EXT   "param"

File extension for parameter files.

Definition at line 154 of file filename.h.

◆ SOL_EXT

#define SOL_EXT   "sol"

File extension for solution files.

Definition at line 160 of file filename.h.

◆ SOL_WITH_DUMMIES_EXT

#define SOL_WITH_DUMMIES_EXT   "dsol"

File extension for solution files including dummy variables.

Definition at line 166 of file filename.h.

◆ AXES_EXT

#define AXES_EXT   "axes"

File extension for mechanism axes.

Definition at line 172 of file filename.h.

◆ COST_EXT

#define COST_EXT   "cost"

File extension for sets of costs. Used to colorize atlas.

Definition at line 178 of file filename.h.

◆ ENERGY_EXT

#define ENERGY_EXT   "energy"

File extension for sets of energy.

Definition at line 184 of file filename.h.

◆ WORLD_EXT

#define WORLD_EXT   "world"

File extension for problem files.

Definition at line 190 of file filename.h.

◆ PLOT3D_EXT

#define PLOT3D_EXT   "gcl"

File extension for 3D plot files.

Definition at line 196 of file filename.h.

◆ PLOT2D_EXT

#define PLOT2D_EXT   "fig"

File extension for 2D plot files.

Definition at line 202 of file filename.h.

◆ LINKS_EXT

#define LINKS_EXT   "links"

File extension for files including samples represented giving poses for the links.

Definition at line 209 of file filename.h.

◆ JOINTS_EXT

#define JOINTS_EXT   "joints"

File extension for files including samples represented giving values for the degrees of freedom.

Definition at line 216 of file filename.h.

◆ STATE_EXT

#define STATE_EXT   "state"

File extension for files storing the interval solver state.

Definition at line 222 of file filename.h.

◆ ATLAS_EXT

#define ATLAS_EXT   "atlas"

File extension for files storing atlas on manifolds.

Definition at line 228 of file filename.h.

◆ ATLAS_GRAPH_EXT

#define ATLAS_GRAPH_EXT   "agraph"

File extension for files storing neighbouring relation between the charts in an antals.

Definition at line 235 of file filename.h.

◆ RRT_EXT

#define RRT_EXT   "rrt"

File extension for files storing rrts on manifolds.

Definition at line 241 of file filename.h.

◆ ATLAS_RRT_EXT

#define ATLAS_RRT_EXT   "arrt"

File extension for files storing AtlasRRTs. These files store the information linking the RRT and the Atlas

Definition at line 248 of file filename.h.

◆ RES_EXT

#define RES_EXT   "res"

File extension for files storing the identifiers of the residues to be considered flexible in a given protein. If this file does not exits the degrees of freedom are deduced from the bond type (double bonds are fixed and single bonds allow for rotations).

Definition at line 257 of file filename.h.

◆ RIGID_EXT

#define RIGID_EXT   "rigids"

File extension for files storing the rigid parts of a given molecule The files include a list of atoms together with the identifier of the rigid including them, if any. Atoms in no rigid are assigned to 0.

Definition at line 265 of file filename.h.

◆ HINGE_EXT

#define HINGE_EXT   "hinges"

File extension for files storing the hinges connecting the rigid parts of a given molecules. The hinges are a set of rotation between given pairs of atoms.

Definition at line 273 of file filename.h.

◆ TENSEGRITY_EXT

#define TENSEGRITY_EXT   "tens"

File extension for files describing tensegrity structures.

Definition at line 279 of file filename.h.

◆ FORCES_EXT

#define FORCES_EXT   "forces"

File extension for files including foces. They are typically generated with the cuikworldforces application, processing a solution set (i.e., a solution path of a planning process).

Definition at line 288 of file filename.h.

Function Documentation

◆ CreateFileName()

void CreateFileName ( char *  path,
char *  name,
char *  suffix,
char *  ext,
Tfilename fn 
)

Generates a Tfilename structure.

Parameters
pathThe path. If not given we get it from the system and is the path from of the directory from where the application is exeucted.
nameThe name of the file. If the given name includes part of a path, it is removed from the name and added to the path data field.
suffixA suffix to add to the name. Possibly NULL.
extThe extension for the file.
fnThe filename structure to create.

Definition at line 22 of file filename.c.

References Tfilename::baseName, Error(), Tfilename::ext, FALSE, Tfilename::fullName, Tfilename::name, NEW, and Tfilename::path.

Referenced by body2SDF(), GetAtomPositions(), IncrementalSampleCuikSystemInBox(), InitCSWDFromFile(), InitParametersFromFile(), LinkFileNameWithExtension(), LoadAtlasRRT(), main(), on_cuikexplore_save(), on_cuikmove_save(), PlotAtlasRRT(), PlotConnection(), PlotQrand(), PrintPolyhedron(), PrintWorld(), PrintWorldCS(), ReadOneSample(), ReadResidueList(), ReadRigidsAndHinges(), ReadTwoSamples(), SampleCuikSystemInBox(), SaveAtlasGraph(), SaveAtlasRRT(), SaveChartCenters(), SaveRRTCosts(), SaveRRTNodes(), SaveSamples(), SaveSamplesN(), SaveSingularCharts(), and SaveTrajectory().

◆ GetFileFullName()

◆ GetFilePath()

char* GetFilePath ( Tfilename fn)

Gets the file path.

Parameters
fnThe filename structure.
Returns
Returns the path for the file.

Definition at line 156 of file filename.c.

References Tfilename::path.

Referenced by LinkFileNameWithExtension(), main(), on_cuikmove_save(), and PrintWorld().

◆ GetFileBaseName()

char* GetFileBaseName ( Tfilename fn)

Gets the file base name (paht+name).

Parameters
fnThe filename structure.
Returns
Returns the base name (path+name) for the file.

Definition at line 166 of file filename.c.

References Tfilename::baseName.

Referenced by main().

◆ GetFileName()

char* GetFileName ( Tfilename fn)

Gets the file name.

Parameters
fnThe filename structure.
Returns
Returns the name for the file.

Definition at line 161 of file filename.c.

References Tfilename::name.

Referenced by LinkFileNameWithExtension(), main(), and PrintWorld().

◆ GetFileExtension()

char* GetFileExtension ( Tfilename fn)

Gets the file extension.

Parameters
fnThe filename structure.
Returns
Returns the extension for the file.

Definition at line 171 of file filename.c.

References Tfilename::ext.

Referenced by InitPolyhedronFromFile(), and PrintWorld().

◆ LinkFileNameWithExtension()

void LinkFileNameWithExtension ( char *  fn1,
char *  ext,
Tfilename fn2 
)

Creates a link to a given filename with a given extension.

Parameters
fn1File to link.
extExtension of the files.
fn2File name of the link.

Definition at line 177 of file filename.c.

References CreateFileName(), DeleteFileName(), GetFileFullName(), GetFileName(), and GetFilePath().

Referenced by main().

◆ DeleteFileName()