Rigid Body Dynamics Library
RigidBodyDynamics::Addons Namespace Reference

Namespaces

namespace  Balance
 
namespace  Geometry
 
namespace  Muscle
 

Functions

RBDL_ADDON_DLLAPI bool URDFReadFromFile (const char *filename, Model *model, bool floating_base, bool verbose=false)
 
RBDL_ADDON_DLLAPI bool URDFReadFromString (const char *model_xml_string, Model *model, bool floating_base, bool verbose=false)
 
RBDL_ADDON_DLLAPI bool LuaModelReadFromFile (const char *filename, Model *upd_model, bool verbose=false)
 Reads a model from a Lua file. More...
 
RBDL_ADDON_DLLAPI void LuaModelGetCoordinateNames (const Model *model, std::vector< std::string > &updGeneralizedPositionNames, std::vector< std::string > &updGeneralizedVelocityNames, std::vector< std::string > &updGeneralizedForceNames)
 
RBDL_ADDON_DLLAPI std::vector< std::string > LuaModelGetConstraintSetNames (const char *filename)
 Reads a model file and returns the names of all constraint sets. More...
 
RBDL_ADDON_DLLAPI bool LuaModelGetConstraintSetPhases (const char *filename, const std::vector< std::string > &constraint_set_names, std::vector< unsigned int > &constraint_set_phases)
 
RBDL_ADDON_DLLAPI bool LuaModelReadMotionCaptureMarkers (const char *filename, const Model *model, std::vector< MotionCaptureMarker > &upd_marker_set, bool verbose=false)
 
RBDL_ADDON_DLLAPI bool LuaModelReadPoints (const char *filename, const Model *model, std::vector< Point > &upd_point_set, bool verbose=false)
 
RBDL_ADDON_DLLAPI bool LuaModelReadLocalFrames (const char *filename, const Model *model, std::vector< LocalFrame > &upd_local_frame_set, bool verbose=false)
 
RBDL_ADDON_DLLAPI bool LuaModelReadFromFileWithConstraints (const char *filename, Model *upd_model, std::vector< ConstraintSet > &constraint_sets, const std::vector< std::string > &constraint_set_names, bool verbose=false)
 Reads a model and constraint sets from a Lua file. More...
 
RBDL_ADDON_DLLAPI bool LuaModelReadFromLuaState (lua_State *L, Model *model, bool verbose=false)
 Reads a model from a lua_State. More...
 
RBDL_ADDON_DLLAPI bool LuaModelReadHumanMetaData (const char *filename, HumanMetaData &human_meta_data, bool verbose=false)
 
RBDL_ADDON_DLLAPI bool LuaModelReadMillard2016TorqueMuscleSets (const char *filename, const RigidBodyDynamics::Model *model, const HumanMetaData &human_meta_data, std::vector< RigidBodyDynamics::Addons::Muscle::Millard2016TorqueMuscle > &updMtgSet, std::vector< Millard2016TorqueMuscleConfig > &updMtgSetInfo, bool verbose=false)
 
RBDL_ADDON_DLLAPI bool LuaModelWriteModelHeaderEntries (const char *header_file_name, const RigidBodyDynamics::Model &model, bool append)
 
RBDL_ADDON_DLLAPI bool LuaModelAddHeaderGuards (const char *header_file_name)
 
RBDL_ADDON_DLLAPI bool LuaModelWritePointsHeaderEntries (const char *header_file_name, const std::vector< Point > &point_set, bool append)
 
RBDL_ADDON_DLLAPI bool LuaModelWriteMotionCaptureMarkerHeaderEntries (const char *header_file_name, const std::vector< MotionCaptureMarker > &marker_set, bool append)
 
RBDL_ADDON_DLLAPI bool LuaModelWriteLocalFrameHeaderEntries (const char *header_file_name, const std::vector< LocalFrame > &local_frame_set, bool append)
 
RBDL_ADDON_DLLAPI bool LuaModelWriteConstraintSetHeaderEntries (const char *header_file_name, const std::vector< std::string > &constraint_set_names, const std::vector< RigidBodyDynamics::ConstraintSet > &constraint_sets, bool append)
 
RBDL_ADDON_DLLAPI bool LuaModelWriteConstraintSetPhaseHeaderEntries (const char *header_file_name, const std::vector< std::string > &constraint_set_names, const std::vector< unsigned int > &constraint_phases, bool append)
 
RBDL_ADDON_DLLAPI bool LuaModelWriteMillard2016TorqueMuscleHeaderEntries (const char *header_file_name, const std::vector< RigidBodyDynamics::Addons::Muscle ::Millard2016TorqueMuscle > &mtg_set, const std::vector< Millard2016TorqueMuscleConfig > &mtg_set_info, bool append)
 

Function Documentation

◆ LuaModelAddHeaderGuards()

RBDL_ADDON_DLLAPI bool RigidBodyDynamics::Addons::LuaModelAddHeaderGuards ( const char *  header_file_name)

Will prepend and append header guards where the name is given by the capitlized form of the file name.

Parameters
header_file_namethe name of the header file

◆ LuaModelGetConstraintSetNames()

RBDL_ADDON_DLLAPI std::vector< std::string > RigidBodyDynamics::Addons::LuaModelGetConstraintSetNames ( const char *  filename)

Reads a model file and returns the names of all constraint sets.

◆ LuaModelGetConstraintSetPhases()

RBDL_ADDON_DLLAPI bool RigidBodyDynamics::Addons::LuaModelGetConstraintSetPhases ( const char *  filename,
const std::vector< std::string > &  constraint_set_names,
std::vector< unsigned int > &  constraint_set_phases 
)

◆ LuaModelGetCoordinateNames()

RBDL_ADDON_DLLAPI void RigidBodyDynamics::Addons::LuaModelGetCoordinateNames ( const Model *  model,
std::vector< std::string > &  updGeneralizedPositionNames,
std::vector< std::string > &  updGeneralizedVelocityNames,
std::vector< std::string > &  updGeneralizedForceNames 
)

◆ LuaModelReadFromFile()

RBDL_ADDON_DLLAPI bool RigidBodyDynamics::Addons::LuaModelReadFromFile ( const char *  filename,
Model *  upd_model,
bool  verbose = false 
)

Reads a model from a Lua file.

Parameters
filenamethe name of the Lua file.
upd_modela pointer to the output Model structure.
verbosespecifies wether information on the model should be printed (default: true).
Returns
true if the model was read successfully.
Note
See Lua Models for information on how to define the Lua model.

◆ LuaModelReadFromFileWithConstraints()

RBDL_ADDON_DLLAPI bool RigidBodyDynamics::Addons::LuaModelReadFromFileWithConstraints ( const char *  filename,
Model *  upd_model,
std::vector< ConstraintSet > &  constraint_sets,
const std::vector< std::string > &  constraint_set_names,
bool  verbose = false 
)

Reads a model and constraint sets from a Lua file.

Parameters
filenamethe name of the Lua file.
upd_modela pointer to the output Model structure.
constraint_setsreference to a std::vector of ConstraintSet structures in which to save the information read from the file.
constraint_set_namesreference to a std::vector of std::string specifying the names of the constraint sets to be read from the Lua file.
verbosespecifies wether information on the model should be printed (default: true).
Returns
true if the model and constraint sets were read successfully.
Note
constraint_sets and constraint_set_names are required to have the same size. See Lua Models for information on how to define the Lua model.

◆ LuaModelReadFromLuaState()

RBDL_ADDON_DLLAPI bool RigidBodyDynamics::Addons::LuaModelReadFromLuaState ( lua_State *  L,
Model *  model,
bool  verbose = false 
)

Reads a model from a lua_State.

Parameters
La pointer to the lua_State.
modela pointer to the output Model structure.
verbosespecifies wether information on the model should be printed (default: true).
Returns
true if the model was read successfully.

◆ LuaModelReadHumanMetaData()

RBDL_ADDON_DLLAPI bool RigidBodyDynamics::Addons::LuaModelReadHumanMetaData ( const char *  filename,
HumanMetaData human_meta_data,
bool  verbose = false 
)

This function will read in the data contained in the 'HumanMetaData' table in the lua file.

Parameters
filenamename of the lua file
human_meta_dataan empty HumanMetaData structure
verboseinformation will be printed to the command window if this is set to true.

◆ LuaModelReadLocalFrames()

RBDL_ADDON_DLLAPI bool RigidBodyDynamics::Addons::LuaModelReadLocalFrames ( const char *  filename,
const Model *  model,
std::vector< LocalFrame > &  upd_local_frame_set,
bool  verbose = false 
)

This function will load the local frames from the lua file into the std::vector of LocalFrame structures.

Parameters
filenamename of the lua file
modelreference to the (loaded) multibody model.
upd_local_frame_setan empty std::vector of LocalFrame structurs
verboseinformation will be printed to the command window if this is set to true.

◆ LuaModelReadMillard2016TorqueMuscleSets()

RBDL_ADDON_DLLAPI bool RigidBodyDynamics::Addons::LuaModelReadMillard2016TorqueMuscleSets ( const char *  filename,
const RigidBodyDynamics::Model *  model,
const HumanMetaData human_meta_data,
std::vector< RigidBodyDynamics::Addons::Muscle::Millard2016TorqueMuscle > &  updMtgSet,
std::vector< Millard2016TorqueMuscleConfig > &  updMtgSetInfo,
bool  verbose = false 
)

This function will read the information for each millard2016_torque_muscle into the vector of Millard2016TorqueMuscleConfig structs and populate a corresponding vector of Millard2016TorqueMuscle objects. Note that the struct Millard2016TorqueMuscleConfig contains information needed not just to create an Millard2016TorqueMuscle object but also the information needed to retrieve the correct q index, qdot index, and activation index from the state vector to evaluate the joint torque and to update the generalized torque vector. Please see the doxygen on Millard2016TorqueMuscle.h and Millard2016TorqueMuscleConfig for more details.

Parameters
filenamethe name of the Lua file.
modela pointer to the populated Model structure
human_meta_datathe meta data for this subject.
updMtgSetan empty vector of Millard2016TorqueMuscle objects
updMtgSetInfoan empty vector of Millard2016TorqueMuscleConfig structs
verbosespecifies wether information on the model should be printed (default: true).
Returns
true if the model and constraint sets were read successfully.

◆ LuaModelReadMotionCaptureMarkers()

RBDL_ADDON_DLLAPI bool RigidBodyDynamics::Addons::LuaModelReadMotionCaptureMarkers ( const char *  filename,
const Model *  model,
std::vector< MotionCaptureMarker > &  upd_marker_set,
bool  verbose = false 
)

This function will load named body-fixed motion capture markers that are attached to each body

Parameters
filenamename of the lua file
modelreference to the (loaded) multibody model.
upd_marker_setan empty std::vector of Point structure
verboseinformation will be printed to the command window if this is set to true.

◆ LuaModelReadPoints()

RBDL_ADDON_DLLAPI bool RigidBodyDynamics::Addons::LuaModelReadPoints ( const char *  filename,
const Model *  model,
std::vector< Point > &  upd_point_set,
bool  verbose = false 
)

This function will load the point information from the lua file into the std::vector of Point structures.

Parameters
filenamename of the lua file
modelreference to the (loaded) multibody model.
upd_point_setan empty std::vector of Point structurs
verboseinformation will be printed to the command window if this is set to true.

◆ LuaModelWriteConstraintSetHeaderEntries()

RBDL_ADDON_DLLAPI bool RigidBodyDynamics::Addons::LuaModelWriteConstraintSetHeaderEntries ( const char *  header_file_name,
const std::vector< std::string > &  constraint_set_names,
const std::vector< RigidBodyDynamics::ConstraintSet > &  constraint_sets,
bool  append 
)

Generates a number of enums and structures so that each individual constraint row can be selected individually, by user-defined-group id, or constraint set. Note: this header information must be appended prior to the constraint phase data otherwise the header will not compile.

Parameters
header_file_namethe name of the header file
constraint_set_namesthe names of the constraint sets returned by the function LuaModelGetConstraintSetNames
constraint_setsthe vector of populated constraint sets
appendfalse: any existing text will be discarded, true: this text will be appended to the file

◆ LuaModelWriteConstraintSetPhaseHeaderEntries()

RBDL_ADDON_DLLAPI bool RigidBodyDynamics::Addons::LuaModelWriteConstraintSetPhaseHeaderEntries ( const char *  header_file_name,
const std::vector< std::string > &  constraint_set_names,
const std::vector< unsigned int > &  constraint_phases,
bool  append 
)

Generates an enum and a structure so that each constraint set associated with a constraint phase can be easily retreived, and its name can be written to file.

Parameters
header_file_namethe name of the header file
constraint_set_namesthe names of the constraint sets returned by the function LuaModelGetConstraintSetNames
constraint_phasesthe ordering of the constraint set indices returned by LuaModelGetConstraintSetPhases
appendfalse: any existing text will be discarded, true: this text will be appended to the file

◆ LuaModelWriteLocalFrameHeaderEntries()

RBDL_ADDON_DLLAPI bool RigidBodyDynamics::Addons::LuaModelWriteLocalFrameHeaderEntries ( const char *  header_file_name,
const std::vector< LocalFrame > &  local_frame_set,
bool  append 
)

Generates a header file with human-readable enums for the local frames. In addition a struct is generated so that text of these names can be used to write post-processing scripts/generate sensible messages

Parameters
header_file_namethe name of the header file
local_frame_seta reference to the populated vector of local frames
appendfalse: any existing text will be discarded, true: this text will be appended to the file

◆ LuaModelWriteMillard2016TorqueMuscleHeaderEntries()

RBDL_ADDON_DLLAPI bool RigidBodyDynamics::Addons::LuaModelWriteMillard2016TorqueMuscleHeaderEntries ( const char *  header_file_name,
const std::vector< RigidBodyDynamics::Addons::Muscle ::Millard2016TorqueMuscle > &  mtg_set,
const std::vector< Millard2016TorqueMuscleConfig > &  mtg_set_info,
bool  append 
)

Generates an enum and a structure so that each Millard2016TorqueMuscle can be easily retreived, and its name can be written to file.

Parameters
header_file_namethe name of the header file
mtg_setthe vector of populated Millard2016TorqueMuscle objects
mtg_set_infothe vector of Millard2016TorqueMuscleConfig structures
appendfalse: any existing text will be discarded, true: this text will be appended to the file

◆ LuaModelWriteModelHeaderEntries()

RBDL_ADDON_DLLAPI bool RigidBodyDynamics::Addons::LuaModelWriteModelHeaderEntries ( const char *  header_file_name,
const RigidBodyDynamics::Model &  model,
bool  append 
)

Generates a header file with human-readable enums for each of the generalized positions, velocity, accelerations, and forces of the model. In addition, a struct is generated so that the names of these elements can be written to file to make post-processing more systematic. This function is quite comprehensive and will correctly handle the extra degrees of freedom added, for example, to the generalized position vector by a quaternion joint.

Parameters
header_file_namethe name of the header file
modela reference to the populated model.
appendfalse: any existing text will be discarded, true: this text will be appended to the file

◆ LuaModelWriteMotionCaptureMarkerHeaderEntries()

RBDL_ADDON_DLLAPI bool RigidBodyDynamics::Addons::LuaModelWriteMotionCaptureMarkerHeaderEntries ( const char *  header_file_name,
const std::vector< MotionCaptureMarker > &  marker_set,
bool  append 
)

Generates a header file with human-readable enums for the markers. In addition a struct is generated so that text of these names can be used to write post-processing scripts/generate sensible messages

Parameters
header_file_namethe name of the header file
marker_seta reference to the populated vector of motion capture markers
appendfalse: any existing text will be discarded, true: this text will be appended to the file

◆ LuaModelWritePointsHeaderEntries()

RBDL_ADDON_DLLAPI bool RigidBodyDynamics::Addons::LuaModelWritePointsHeaderEntries ( const char *  header_file_name,
const std::vector< Point > &  point_set,
bool  append 
)

Generates a header file with human-readable enums for the points. In addition a struct is generated so that text of these names can be used to write post-processing scripts/generate sensible messages

Parameters
header_file_namethe name of the header file
point_seta reference to the populated vector of points
appendfalse: any existing text will be discarded, true: this text will be appended to the file

◆ URDFReadFromFile()

RBDL_ADDON_DLLAPI bool RigidBodyDynamics::Addons::URDFReadFromFile ( const char *  filename,
Model *  model,
bool  floating_base,
bool  verbose = false 
)

This function will load a URDF model from a file.

Parameters
filenamepath to the URDF file
modelreference to the (loaded) multibody model
floating_pasedoes the model use a floating base
verboseinformation will be printed to the command window if this is set to true

◆ URDFReadFromString()

RBDL_ADDON_DLLAPI bool RigidBodyDynamics::Addons::URDFReadFromString ( const char *  model_xml_string,
Model *  model,
bool  floating_base,
bool  verbose = false 
)

This function will load a URDF model from a c string.

Parameters
model_xml_stringURDF data in form of a string
modelreference to the (loaded) multibody model
floating_pasedoes the model use a floating base
verboseinformation will be printed to the command window if this is set to true