Expose 'flags' option for loadURDF, to allow customization of the URDF loading process while maintaining backward compatibility.

For example: URDF_USE_INERTIA_FROM_FILE flag. By default, URDF2Bullet will re-compute the inertia tensor based on mass and volume, because most URDF files have bogus Inertia values.
This commit is contained in:
Erwin Coumans
2017-03-27 08:30:20 -07:00
parent d78909aef9
commit 4911916937
9 changed files with 44 additions and 13 deletions

View File

@@ -238,6 +238,19 @@ int b3LoadUrdfCommandSetUseFixedBase(b3SharedMemoryCommandHandle commandHandle,
return -1;
}
int b3LoadUrdfCommandSetFlags(b3SharedMemoryCommandHandle commandHandle, int flags)
{
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle;
b3Assert(command);
b3Assert(command->m_type == CMD_LOAD_URDF);
if (command && (command->m_type == CMD_LOAD_URDF))
{
command->m_updateFlags |= URDF_ARGS_HAS_CUSTOM_URDF_FLAGS;
command->m_urdfArguments.m_urdfFlags = flags;
}
return 0;
}
int b3LoadUrdfCommandSetStartPosition(b3SharedMemoryCommandHandle commandHandle, double startPosX,double startPosY,double startPosZ)
{
struct SharedMemoryCommand* command = (struct SharedMemoryCommand*) commandHandle;