use white as default undefined color instead of the googley colors.

use loadURDF(..., flags = pybullet.URDF_GOOGLEY_UNDEFINED_COLORS) to get Googley colors when colors are undefined.
This commit is contained in:
Erwin Coumans
2020-05-08 10:44:39 -07:00
parent daa0a27403
commit 8f380b3fd2
6 changed files with 25 additions and 13 deletions
@@ -931,6 +931,7 @@ enum eURDF_Flags
URDF_IGNORE_VISUAL_SHAPES = 1 << 20,
URDF_IGNORE_COLLISION_SHAPES = 1 << 21,
URDF_PRINT_URDF_INFO = 1 << 22,
URDF_GOOGLEY_UNDEFINED_COLORS = 1 << 23,
};
enum eUrdfGeomTypes //sync with UrdfParser UrdfGeomTypes
@@ -646,7 +646,7 @@ static void convertURDFToVisualShape(const UrdfShape* visual, const char* urdfPa
delete glmesh;
}
static btVector4 sColors[4] =
static btVector4 sGoogleyColors[4] =
{
btVector4(60. / 256., 186. / 256., 84. / 256., 1),
btVector4(244. / 256., 194. / 256., 13. / 256., 1),
@@ -705,7 +705,7 @@ int TinyRendererVisualShapeConverter::convertVisualShapes(
colorIndex = 0;
colorIndex &= 3;
btVector4 color;
color = sColors[colorIndex];
color = (m_data->m_flags & URDF_GOOGLEY_UNDEFINED_COLORS) ? sGoogleyColors[colorIndex] : btVector4(1, 1, 1, 1);
float rgbaColor[4] = {(float)color[0], (float)color[1], (float)color[2], (float)color[3]};
//if (colObj->getCollisionShape()->getShapeType()==STATIC_PLANE_PROXYTYPE)
//{