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:
@@ -260,6 +260,8 @@ int b3RobotSimulatorClientAPI::loadURDF(const std::string& fileName, const struc
|
||||
|
||||
//setting the initial position, orientation and other arguments are optional
|
||||
|
||||
b3LoadUrdfCommandSetFlags(command,args.m_flags);
|
||||
|
||||
b3LoadUrdfCommandSetStartPosition(command, args.m_startPosition[0],
|
||||
args.m_startPosition[1],
|
||||
args.m_startPosition[2]);
|
||||
|
||||
@@ -15,12 +15,14 @@ struct b3RobotSimulatorLoadUrdfFileArgs
|
||||
b3Quaternion m_startOrientation;
|
||||
bool m_forceOverrideFixedBase;
|
||||
bool m_useMultiBody;
|
||||
int m_flags;
|
||||
|
||||
b3RobotSimulatorLoadUrdfFileArgs()
|
||||
: m_startPosition(b3MakeVector3(0, 0, 0)),
|
||||
m_startOrientation(b3Quaternion(0, 0, 0, 1)),
|
||||
m_forceOverrideFixedBase(false),
|
||||
m_useMultiBody(true)
|
||||
m_useMultiBody(true),
|
||||
m_flags(0)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user