cuikworld2sdf.cpp File Reference IntroductionMain body of the cuikworld2sdf application. This application reads the information in a world file and generates an equivalent SDF file. SDF files are the input files for Gazebo. See the SDF format specification for more details. This application is our first attempt to interface the CuikPackages with Gazebo. The idea is to obtain nicer mechanisms simulations, including dynamical aspects. Beside the generation of SDF files, we would also need to implement a cuikgazeboplayer (i.e., a way to command gazefo robots from the cuik outputs). Note that we implement a world2sdf and not a world2urdf. This is because the urdf is a severily liminted format which can not handle kinematic loops, the fundamental construction in the CuikSuite. Here you have a very nice argument about why to use the SDF format instead of the URDF one. CAUTION: This application is in development and not tested at all yet (we need to install Gazebo to test it properly). Up to now, links seems to be correctly exported but conversion of joints is still to be tested.
Definition in file cuikworld2sdf.cpp.
Function Documentation◆ body2SDF()
Generates the sdf code for a given body in a link (might be a static link, i.e., the world).
Definition at line 139 of file cuikworld2sdf.cpp. References CreateFileName(), CYLINDER, DeleteFileName(), DifferenceVector(), EMPTY_BODY, Error(), GetBlue(), GetFileFullName(), GetGreen(), GetPolyhedronCenter(), GetPolyhedronColor(), GetPolyhedronDefiningPoint(), GetPolyhedronRadius(), GetPolyhedronStatus(), GetPolyhedronType(), GetRed(), GetYawPitchRoll(), HIDDEN_SHAPE, HTransformGetElement(), HTransformProduct(), HTransformRy(), HTransformTz(), HTransformX2Vect(), LINE, M_PI_2, Norm(), Normalize(), OFF, SEGMENTS, SPHERE, SumVector(), and WriteDAEMesh(). Referenced by main(). ◆ jointHeader2SDF()
Adds the header of a joint definition in sdf.
Definition at line 279 of file cuikworld2sdf.cpp. Referenced by main(). ◆ axis2SDF()
Generates the sdf code for a given joint axis (used in revolute, prismatic, universal joints)
Definition at line 301 of file cuikworld2sdf.cpp. References DifferenceVector(), GetYawPitchRoll(), HTransformGetElement(), HTransformInverse(), HTransformProduct(), INF, LowerLimit(), Normalize(), and UpperLimit(). Referenced by main(). ◆ main()
Main body of the cuikworld2sdf application. Use:
where
The .world and .sdf extensions are optional. The idea is to generate all the files in a given folder that can be moved/linked to/from the gazebo model directory (typically .gazebo/models). Example of use:
Then open the sdf/jaco.sdf in gazebo.
Definition at line 430 of file cuikworld2sdf.cpp. References axis2SDF(), body2SDF(), CreateFileName(), DeleteFileName(), DeleteLinkTransforms(), DeleteParameters(), DeleteWorld(), Error(), FALSE, FIX_JOINT, FREE_JOINT, GetFileFullName(), GetFileName(), GetFilePath(), GetJointDamping(), GetJointEffort(), GetJointFrame(), GetJointFriction(), GetJointPoint(), GetJointRange(), GetJointSecondRange(), GetJointType(), GetJointVelocity(), GetLinkBody(), GetLinkConfExtension(), GetLinkInertialFrame(), GetLinkInertiaMatrix(), GetLinkMass(), GetLinkName(), GetLinkTransformsFromSolutionPoint(), GetLinkType(), GetWorldJoint(), GetWorldLink(), GetWorldNJoints(), GetWorldNLinks(), GetWorldNObstacles(), GetWorldNumSystemVariables(), GetWorldObstacle(), GetWorldObstacleName(), GetYawPitchRoll(), HTransformAcumTrans(), HTransformApplyRot(), HTransformCopy(), HTransformGetElement(), InitParametersFromFile(), InitWorldFromFile(), JointFrom(), JointFromID(), jointHeader2SDF(), JointTo(), JointToID(), LimitedJoint(), LINK_DeformX, LINK_NoRot, LINK_PrismaticX, LinkNBodies(), NEW, PARAM_EXT, PRS_JOINT, ReadOneSample(), REV_JOINT, SDF_EXT, SPH_JOINT, SPH_SPH_LOW_JOINT, SPH_SPH_UP_JOINT, SumVector(), TRUE, and UNV_JOINT. |
Follow us!