SCL  1.0
Standard Control Library : Control, dynamics, physics, and simulation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
scl::CParserSai Class Reference

#include <CParserSai.hpp>

Inheritance diagram for scl::CParserSai:
Inheritance graph
[legend]
Collaboration diagram for scl::CParserSai:
Collaboration graph
[legend]

Public Member Functions

virtual bool listRobotsInFile (const std::string &arg_file, std::vector< std::string > &arg_robot_names)
 
virtual bool readRobotFromFile (const std::string &arg_file, const std::string &arg_robot_name, scl::SRobotParsed &arg_robot_object)
 
virtual bool saveRobotToFile (scl::SRobotParsed &arg_robot, const std::string &arg_file)
 
virtual bool listGraphicsInFile (const std::string &arg_file, std::vector< std::string > &arg_graphics_names)
 
virtual bool readGraphicsFromFile (const std::string &arg_file, const std::string &arg_graphics_name, scl::SGraphicsParsed &arg_graphics)
 
virtual bool listMuscleSysInFile (const std::string &arg_file, std::vector< std::string > &arg_msys_names)
 
virtual bool readMuscleSysFromFile (const std::string &arg_file, const std::string &arg_msys_name, scl::SActuatorSetMuscleParsed &arg_msys)
 
virtual bool listUISpecsInFile (const std::string &arg_file, std::vector< std::string > &arg_ui_spec_names)
 
virtual bool readUISpecFromFile (const std::string &arg_file, const std::string &arg_ui_spec_name, scl::SUIParsed &arg_ui_spec)
 
virtual bool listControllersInFile (const std::string &arg_file, std::vector< std::pair< std::string, std::string > > &arg_ctrl_name_and_type)
 
virtual bool readGcControllerFromFile (const std::string &arg_file, const std::string &arg_ctrl_name, std::string &ret_must_use_robot, scl::SControllerGc &arg_ctrl)
 
virtual bool readTaskControllerFromFile (const std::string &arg_file, const std::string &arg_ctrl_name, std::string &ret_must_use_robot, std::vector< scl::STaskBase * > &ret_taskvec, std::vector< scl::SNonControlTaskBase * > &ret_task_non_ctrl_vec)
 

Private Member Functions

bool readLink (const scl_tinyxml::TiXmlHandle &arg_tiHndl_link, const bool arg_is_root, const std::string &arg_parent_lnk_name, scl::SRobotParsed &arg_robot)
 

Private Attributes

const std::string root_link_name_
 

Detailed Description

This class implements a limited subset of the CParserBase API for the legacy "SAI" file format.

Uses tinyXml to parse files.

Member Function Documentation

virtual bool scl::CParserBase::listControllersInFile ( const std::string &  arg_file,
std::vector< std::pair< std::string, std::string > > &  arg_ctrl_name_and_type 
)
inlinevirtualinherited

Optional: The subclass may support read out the controller specifications in a file. Each controller is to be stored as a <name, type> pair

Reimplemented in scl::CParserScl.

virtual bool scl::CParserSai::listGraphicsInFile ( const std::string &  arg_file,
std::vector< std::string > &  arg_graphics_names 
)
inlinevirtual

Optional: Returns a list of graphics views in a file. Required : If readGraphicsFromFile() is implemented

Reimplemented from scl::CParserBase.

virtual bool scl::CParserBase::listMuscleSysInFile ( const std::string &  arg_file,
std::vector< std::string > &  arg_msys_names 
)
inlinevirtualinherited

Optional: Returns a list of muscle systems in a file. Required : If readMuscleSysFromFile() is implemented

virtual bool scl::CParserSai::listRobotsInFile ( const std::string &  arg_file,
std::vector< std::string > &  arg_robot_names 
)
inlinevirtual

Returns a list of robots and the files in which their specifications reside.

Implements scl::CParserBase.

virtual bool scl::CParserBase::listUISpecsInFile ( const std::string &  arg_file,
std::vector< std::string > &  arg_ui_spec_names 
)
inlinevirtualinherited

Optional: If required, the subclass may support parsing user interface specifications.

Reimplemented in scl::CParserScl.

virtual bool scl::CParserBase::readGcControllerFromFile ( const std::string &  arg_file,
const std::string &  arg_ctrl_name,
std::string &  ret_must_use_robot,
scl::SControllerGc arg_ctrl 
)
inlinevirtualinherited

Optional: The subclass may support parsing gc controller specifications (There are 2 different controller reading functions because the data structures are totally incompatible)

Reimplemented in scl::CParserScl.

virtual bool scl::CParserSai::readGraphicsFromFile ( const std::string &  arg_file,
const std::string &  arg_graphics_name,
scl::SGraphicsParsed arg_graphics 
)
inlinevirtual

Optional: If required, the subclass may support parsing graphics specifications.

Reimplemented from scl::CParserBase.

bool scl::CParserSai::readLink ( const scl_tinyxml::TiXmlHandle &  arg_tiHndl_link,
const bool  arg_is_root,
const std::string &  arg_parent_lnk_name,
scl::SRobotParsed arg_robot 
)
private

Recursive SAI link specification reader

virtual bool scl::CParserBase::readMuscleSysFromFile ( const std::string &  arg_file,
const std::string &  arg_msys_name,
scl::SActuatorSetMuscleParsed arg_msys 
)
inlinevirtualinherited

Reads a muscle model from a file.

Reimplemented in scl::CParserOsimForOldFiles, and scl::CParserOsim.

bool scl::CParserSai::readRobotFromFile ( const std::string &  arg_file,
const std::string &  arg_robot_name,
scl::SRobotParsed arg_robot_object 
)
virtual

Only support reading from SAI files. Use the file converter to convert them into Scl files. (applications/scl_file_converter)

Since the SAI format only has one robot in a file, the "arg_robot_name" argument is not used.

Tags not supported:

  1. Damping -> scl's damping is flat
  2. OpID -> don't know what it does
  3. collisionType -> scl doesn't presently have collision support

Notes:

  1. Throws errors when required tags are missing
  2. Prints warnings when non-required but important (dynamics info) tags are missing
  3. Does nothing when default values can usually replace missing tags. Eg. joint limits
  4. Sai seems to support w,x,y,z quaternions in its orientation tag. Eigen supports x,y,z,w.
  5. Sai often has missing orientation tags (for free joints). This info is essential but we'll only issue warnings for now.
Parameters
arg_robot_nameThis argument is useless for SAI files. Only reads the first robot!!!

Implements scl::CParserBase.

virtual bool scl::CParserBase::readTaskControllerFromFile ( const std::string &  arg_file,
const std::string &  arg_ctrl_name,
std::string &  ret_must_use_robot,
std::vector< scl::STaskBase * > &  ret_taskvec,
std::vector< scl::SNonControlTaskBase * > &  ret_task_non_ctrl_vec 
)
inlinevirtualinherited

Optional: The subclass may support parsing task controller specifications (There are 2 different controller reading functions because the data structures are totally incompatible)

Parameters
ret_taskvecReturns a vector of tasks that this task controller can execute. Typically, the task controller will execute all of them simultaneously with a priority order.

Reimplemented in scl::CParserScl.

virtual bool scl::CParserBase::readUISpecFromFile ( const std::string &  arg_file,
const std::string &  arg_ui_spec_name,
scl::SUIParsed arg_ui_spec 
)
inlinevirtualinherited

Optional: If required, the subclass may support parsing user interface specifications.

Reimplemented in scl::CParserScl.

virtual bool scl::CParserSai::saveRobotToFile ( scl::SRobotParsed arg_robot,
const std::string &  arg_file 
)
inlinevirtual

Saves a robot definition to file. Takes the name of the robot and a file name as aguments.

Looks up the robot in the database and writes it to a file if it exists.

Reimplemented from scl::CParserBase.


The documentation for this class was generated from the following files: