try to fix travis, update inertia for Laikago, reset camera at the right time (#3021)

* laikago_toes_zup.urdf: fill in inertia values, computed as PyBullet does internally (from mass and collision volumes)

* reset camera in the rendering thread to avoid artifacts

* reset camera in the rendering thread to avoid artifacts

* try to fix travis error
This commit is contained in:
erwincoumans
2020-08-31 13:35:03 -07:00
committed by GitHub
parent 0ebc43b21e
commit bb1da5b5f5
3 changed files with 46 additions and 16 deletions

View File

@@ -130,6 +130,7 @@ enum MultiThreadedGUIHelperCommunicationEnums
eGUIHelperUpdateShape,
eGUIHelperChangeGraphicsInstanceScaling,
eGUIUserDebugRemoveAllParameters,
eGUIHelperResetCamera,
};
#include <stdio.h>
@@ -1086,9 +1087,25 @@ public:
{
m_childGuiHelper->setUpAxis(axis);
}
float m_resetCameraCamDist;
float m_resetCameraYaw;
float m_resetCameraPitch;
float m_resetCameraCamPosX;
float m_resetCameraCamPosY;
float m_resetCameraCamPosZ;
virtual void resetCamera(float camDist, float yaw, float pitch, float camPosX, float camPosY, float camPosZ)
{
m_childGuiHelper->resetCamera(camDist, yaw, pitch, camPosX, camPosY, camPosZ);
m_cs->lock();
m_resetCameraCamDist = camDist;
m_resetCameraYaw = yaw;
m_resetCameraPitch = pitch;
m_resetCameraCamPosX = camPosX;
m_resetCameraCamPosY = camPosY;
m_resetCameraCamPosZ = camPosZ;
m_cs->setSharedParam(1, eGUIHelperResetCamera);
workerThreadWait();
//m_childGuiHelper->resetCamera(camDist, yaw, pitch, camPosX, camPosY, camPosZ);
}
virtual bool getCameraInfo(int* width, int* height, float viewMatrix[16], float projectionMatrix[16], float camUp[3], float camForward[3], float hor[3], float vert[3], float* yaw, float* pitch, float* camDist, float camTarget[3]) const
@@ -1424,7 +1441,7 @@ public:
float pitch = -35;
float yaw = 50;
float targetPos[3] = {0, 0, 0}; //-3,2.8,-2.5};
m_guiHelper->resetCamera(dist, yaw, pitch, targetPos[0], targetPos[1], targetPos[2]);
m_multiThreadedHelper->m_childGuiHelper->resetCamera(dist, yaw, pitch, targetPos[0], targetPos[1], targetPos[2]);
}
virtual bool wantsTermination();
@@ -2360,6 +2377,19 @@ void PhysicsServerExample::updateGraphics()
m_multiThreadedHelper->mainThreadRelease();
break;
}
case eGUIHelperResetCamera:
{
m_multiThreadedHelper->m_childGuiHelper->resetCamera(
m_multiThreadedHelper->m_resetCameraCamDist,
m_multiThreadedHelper->m_resetCameraYaw,
m_multiThreadedHelper->m_resetCameraPitch,
m_multiThreadedHelper->m_resetCameraCamPosX,
m_multiThreadedHelper->m_resetCameraCamPosY,
m_multiThreadedHelper->m_resetCameraCamPosZ);
m_multiThreadedHelper->mainThreadRelease();
break;
}
case eGUIHelperAutogenerateGraphicsObjects:
{
B3_PROFILE("eGUIHelperAutogenerateGraphicsObjects");