utilities

Timer

class jiminy::Timer

Public Functions

Timer(void)
void tic(void)
void toc(void)

Public Members

std::chrono::time_point<Time> t0
std::chrono::time_point<Time> tf
float64_t dt

IO file and Directory

std::string jiminy::getUserDirectory(void)

Conversion from/to JSON

Warning

doxygenfunction: Unable to resolve function “jiminy::convertToJson” with arguments (T const&) in doxygen xml output for project “jiminy” from directory: /home/runner/work/jiminy/jiminy/build/doxygen/xml. Potential matches:

- Json::Value convertToJson(configHolder_t const &value)
- template<typename T> std::enable_if_t<!is_vector_v<T>, Json::Value> convertToJson(T const &value)
- template<typename T> std::enable_if_t<is_vector_v<T>, Json::Value> convertToJson(T const &value)
configHolder_t jiminy::convertFromJson(Json::Value const &value)

Random number generation

void jiminy::resetRandomGenerators(boost::optional<uint32_t> const &seed = boost::none)
float64_t jiminy::randUniform(float64_t const &lo = 0.0, float64_t const &hi = 1.0)
float64_t jiminy::randNormal(float64_t const &mean = 0.0, float64_t const &std = 1.0)
vectorN_t jiminy::randVectorNormal(uint32_t const &size, float64_t const &mean, float64_t const &std)

Telemetry

Eigen::Ref<vectorN_t const> jiminy::getLogFieldValue(std::string const &fieldName, std::vector<std::string> const &header, matrixN_t const &logData)

Get the value of a single logged variable.

Parameters
  • fieldName[in] Full name of the variable to get

  • header[in] Header, vector of field names.

  • logData[in] Corresponding data in the log file.

Returns

Vector of values for fieldName. If fieldName is not in the header list, this vector will be empty.

Pinocchio

hresult_t jiminy::getJointNameFromPositionIdx(pinocchio::Model const &model, jointIndex_t const &idIn, std::string &jointNameOut)
hresult_t jiminy::getJointNameFromVelocityIdx(pinocchio::Model const &model, jointIndex_t const &idIn, std::string &jointNameOut)
hresult_t jiminy::getJointTypeFromIdx(pinocchio::Model const &model, jointIndex_t const &idIn, joint_t &jointTypeOut)
hresult_t jiminy::getJointTypePositionSuffixes(joint_t const &jointTypeIn, std::vector<std::string> &jointTypeSuffixesOut)
hresult_t jiminy::getJointTypeVelocitySuffixes(joint_t const &jointTypeIn, std::vector<std::string> &jointTypeSuffixesOut)
hresult_t jiminy::getBodyIdx(pinocchio::Model const &model, std::string const &bodyName, frameIndex_t &bodyIdx)
hresult_t jiminy::getBodiesIdx(pinocchio::Model const &model, std::vector<std::string> const &bodiesNames, std::vector<frameIndex_t> &bodiesIdx)
hresult_t jiminy::getFrameIdx(pinocchio::Model const &model, std::string const &frameName, frameIndex_t &frameIdx)
hresult_t jiminy::getFramesIdx(pinocchio::Model const &model, std::vector<std::string> const &framesNames, std::vector<frameIndex_t> &framesIdx)
hresult_t jiminy::getJointModelIdx(pinocchio::Model const &model, std::string const &jointName, jointIndex_t &jointModelIdx)
hresult_t jiminy::getJointsModelIdx(pinocchio::Model const &model, std::vector<std::string> const &jointsNames, std::vector<jointIndex_t> &jointsModelIdx)
hresult_t jiminy::getJointPositionIdx(pinocchio::Model const &model, std::string const &jointName, std::vector<int32_t> &jointPositionIdx)
hresult_t jiminy::getJointsPositionIdx(pinocchio::Model const &model, std::vector<std::string> const &jointsNames, std::vector<int32_t> &jointsPositionIdx, bool_t const &firstJointIdxOnly = false)
hresult_t jiminy::getJointVelocityIdx(pinocchio::Model const &model, std::string const &jointName, std::vector<int32_t> &jointVelocityIdx)
hresult_t jiminy::getJointsVelocityIdx(pinocchio::Model const &model, std::vector<std::string> const &jointsNames, std::vector<int32_t> &jointsVelocityIdx, bool_t const &firstJointIdxOnly = false)
hresult_t jiminy::isPositionValid(pinocchio::Model const &model, vectorN_t const &position, bool_t &isValid, float64_t const &tol)
pinocchio::Force jiminy::convertForceGlobalFrameToJoint(pinocchio::Model const &model, pinocchio::Data const &data, frameIndex_t const &frameIdx, pinocchio::Force const &fextInGlobal)

Convert a force expressed in the global frame of a specific frame to its parent joint frame.

Parameters
  • model[in] Pinocchio model.

  • data[in] Pinocchio data.

  • frameIdx[in] Id of the frame.

  • fextInGlobal[in] Force in the global frame to be converted.

Returns

Force in the parent joint local frame.

Math

Warning

doxygenfunction: Unable to resolve function “jiminy::clamp” with arguments (Eigen::Ref<vectorN_t const> const&, float64_t const&, float64_t const&) in doxygen xml output for project “jiminy” from directory: /home/runner/work/jiminy/jiminy/build/doxygen/xml. Potential matches:

- float64_t clamp(float64_t const &data, float64_t const &minThr = -INF, float64_t const &maxThr = +INF)
- template<typename DerivedType1, typename DerivedType2, typename DerivedType3> Eigen::MatrixBase<DerivedType1> clamp(Eigen::MatrixBase<DerivedType1> const &data, Eigen::MatrixBase<DerivedType2> const &minThr, Eigen::MatrixBase<DerivedType2> const &maxThr)
- template<typename DerivedType> auto clamp(Eigen::MatrixBase<DerivedType> const &data, float64_t const &minThr = -INF, float64_t const &maxThr = +INF)