mirror of
https://github.com/bulletphysics/bullet3
synced 2025-01-07 08:10:08 +00:00
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:
parent
0ebc43b21e
commit
bb1da5b5f5
@ -9,7 +9,7 @@ if [[ "$TRAVIS_OS_NAME" == "linux" && "$CXX" = "g++" ]]; then
|
|||||||
$SUDO apt-get install -y python3-pip
|
$SUDO apt-get install -y python3-pip
|
||||||
$SUDO pip3 install -U wheel
|
$SUDO pip3 install -U wheel
|
||||||
$SUDO pip3 install -U setuptools
|
$SUDO pip3 install -U setuptools
|
||||||
$SUDO python3 setup.py install
|
python3 setup.py install --user
|
||||||
python3 examples/pybullet/unittests/unittests.py --verbose
|
python3 examples/pybullet/unittests/unittests.py --verbose
|
||||||
python3 examples/pybullet/unittests/userDataTest.py --verbose
|
python3 examples/pybullet/unittests/userDataTest.py --verbose
|
||||||
python3 examples/pybullet/unittests/saveRestoreStateTest.py --verbose
|
python3 examples/pybullet/unittests/saveRestoreStateTest.py --verbose
|
||||||
|
@ -130,6 +130,7 @@ enum MultiThreadedGUIHelperCommunicationEnums
|
|||||||
eGUIHelperUpdateShape,
|
eGUIHelperUpdateShape,
|
||||||
eGUIHelperChangeGraphicsInstanceScaling,
|
eGUIHelperChangeGraphicsInstanceScaling,
|
||||||
eGUIUserDebugRemoveAllParameters,
|
eGUIUserDebugRemoveAllParameters,
|
||||||
|
eGUIHelperResetCamera,
|
||||||
};
|
};
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -1086,9 +1087,25 @@ public:
|
|||||||
{
|
{
|
||||||
m_childGuiHelper->setUpAxis(axis);
|
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)
|
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
|
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 pitch = -35;
|
||||||
float yaw = 50;
|
float yaw = 50;
|
||||||
float targetPos[3] = {0, 0, 0}; //-3,2.8,-2.5};
|
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();
|
virtual bool wantsTermination();
|
||||||
@ -2360,6 +2377,19 @@ void PhysicsServerExample::updateGraphics()
|
|||||||
m_multiThreadedHelper->mainThreadRelease();
|
m_multiThreadedHelper->mainThreadRelease();
|
||||||
break;
|
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:
|
case eGUIHelperAutogenerateGraphicsObjects:
|
||||||
{
|
{
|
||||||
B3_PROFILE("eGUIHelperAutogenerateGraphicsObjects");
|
B3_PROFILE("eGUIHelperAutogenerateGraphicsObjects");
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
<inertial>
|
<inertial>
|
||||||
<origin rpy="0 0 0" xyz="0 0 0"/>
|
<origin rpy="0 0 0" xyz="0 0 0"/>
|
||||||
<mass value="13.715"/>
|
<mass value="13.715"/>
|
||||||
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
|
<inertia ixx="0.22" ixy="0" ixz="0" iyy="0.431" iyz="0" izz="0.565"/>
|
||||||
</inertial>
|
</inertial>
|
||||||
<visual>
|
<visual>
|
||||||
<origin rpy="0 0 0" xyz=" 0 0 0"/>
|
<origin rpy="0 0 0" xyz=" 0 0 0"/>
|
||||||
@ -32,7 +32,7 @@
|
|||||||
<inertial>
|
<inertial>
|
||||||
<origin rpy="0 0 0" xyz="0.02 0 0"/>
|
<origin rpy="0 0 0" xyz="0.02 0 0"/>
|
||||||
<mass value="1.095"/>
|
<mass value="1.095"/>
|
||||||
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
|
<inertia ixx="0.002" ixy="0" ixz="0" iyy=".002" iyz="0" izz=".001"/>
|
||||||
</inertial>
|
</inertial>
|
||||||
|
|
||||||
<visual>
|
<visual>
|
||||||
@ -67,7 +67,7 @@
|
|||||||
<inertial>
|
<inertial>
|
||||||
<origin rpy="0 0 0" xyz="0 -0.04 -0.04"/>
|
<origin rpy="0 0 0" xyz="0 -0.04 -0.04"/>
|
||||||
<mass value="1.527"/>
|
<mass value="1.527"/>
|
||||||
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
|
<inertia ixx="0.015" ixy="0" ixz="0" iyy="0.007" iyz="0" izz="0.01"/>
|
||||||
</inertial>
|
</inertial>
|
||||||
<visual>
|
<visual>
|
||||||
<origin rpy="0 0 0" xyz="0 0 0"/>
|
<origin rpy="0 0 0" xyz="0 0 0"/>
|
||||||
@ -102,7 +102,7 @@
|
|||||||
<inertial>
|
<inertial>
|
||||||
<origin rpy="0 0 0" xyz="0 -0.16 -0.02"/>
|
<origin rpy="0 0 0" xyz="0 -0.16 -0.02"/>
|
||||||
<mass value="0.241"/>
|
<mass value="0.241"/>
|
||||||
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
|
<inertia ixx="0.002" ixy="0" ixz="0" iyy="0.002" iyz="0" izz="0.002"/>
|
||||||
</inertial>
|
</inertial>
|
||||||
<visual>
|
<visual>
|
||||||
<origin rpy="0 1.57079 0" xyz="0 0.0 0"/>
|
<origin rpy="0 1.57079 0" xyz="0 0.0 0"/>
|
||||||
@ -137,7 +137,7 @@
|
|||||||
<inertial>
|
<inertial>
|
||||||
<origin rpy="0 0 0" xyz="-.02 0 0"/>
|
<origin rpy="0 0 0" xyz="-.02 0 0"/>
|
||||||
<mass value="1.095"/>
|
<mass value="1.095"/>
|
||||||
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
|
<inertia ixx="0.002" ixy="0" ixz="0" iyy="0.002" iyz="0" izz="0.001"/>
|
||||||
</inertial>
|
</inertial>
|
||||||
<visual>
|
<visual>
|
||||||
<origin rpy="0 0 0" xyz="0 0 0"/>
|
<origin rpy="0 0 0" xyz="0 0 0"/>
|
||||||
@ -174,7 +174,7 @@
|
|||||||
<inertial>
|
<inertial>
|
||||||
<origin rpy="0 0 0" xyz="0 -0.04 -0.04"/>
|
<origin rpy="0 0 0" xyz="0 -0.04 -0.04"/>
|
||||||
<mass value="1.527"/>
|
<mass value="1.527"/>
|
||||||
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
|
<inertia ixx="0.016" ixy="0" ixz="0" iyy="0.007" iyz="0" izz="0.011"/>
|
||||||
</inertial>
|
</inertial>
|
||||||
<visual>
|
<visual>
|
||||||
<origin rpy="0 0 0" xyz="0 0 0"/>
|
<origin rpy="0 0 0" xyz="0 0 0"/>
|
||||||
@ -213,7 +213,7 @@
|
|||||||
<inertial>
|
<inertial>
|
||||||
<origin rpy="0 0 0" xyz="0 -0.16 -0.02"/>
|
<origin rpy="0 0 0" xyz="0 -0.16 -0.02"/>
|
||||||
<mass value="0.241"/>
|
<mass value="0.241"/>
|
||||||
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
|
<inertia ixx="0.002" ixy="0" ixz="0" iyy="0.002" iyz="0" izz="0.002"/>
|
||||||
</inertial>
|
</inertial>
|
||||||
<visual>
|
<visual>
|
||||||
<origin rpy="0 1.57079 0" xyz="0 0 0"/>
|
<origin rpy="0 1.57079 0" xyz="0 0 0"/>
|
||||||
@ -254,7 +254,7 @@
|
|||||||
<inertial>
|
<inertial>
|
||||||
<origin rpy="0 0 0" xyz="0.02 0 0"/>
|
<origin rpy="0 0 0" xyz="0.02 0 0"/>
|
||||||
<mass value="1.095"/>
|
<mass value="1.095"/>
|
||||||
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
|
<inertia ixx="0.002" ixy="0" ixz="0" iyy="0.002" iyz="0" izz="0.001"/>
|
||||||
</inertial>
|
</inertial>
|
||||||
|
|
||||||
<visual>
|
<visual>
|
||||||
@ -291,7 +291,7 @@
|
|||||||
<inertial>
|
<inertial>
|
||||||
<origin rpy="0 0 0" xyz="0 -0.04 -0.04"/>
|
<origin rpy="0 0 0" xyz="0 -0.04 -0.04"/>
|
||||||
<mass value="1.527"/>
|
<mass value="1.527"/>
|
||||||
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
|
<inertia ixx="0.016" ixy="0" ixz="0" iyy="0.007" iyz="0" izz="0.011"/>
|
||||||
</inertial>
|
</inertial>
|
||||||
<visual>
|
<visual>
|
||||||
<origin rpy="0 0 0" xyz="0 0 0"/>
|
<origin rpy="0 0 0" xyz="0 0 0"/>
|
||||||
@ -326,7 +326,7 @@
|
|||||||
<inertial>
|
<inertial>
|
||||||
<origin rpy="0 0 0" xyz="0 -0.16 -0.02"/>
|
<origin rpy="0 0 0" xyz="0 -0.16 -0.02"/>
|
||||||
<mass value="0.241"/>
|
<mass value="0.241"/>
|
||||||
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
|
<inertia ixx="0.002" ixy="0" ixz="0" iyy="0.002" iyz="0" izz="0.002"/>
|
||||||
</inertial>
|
</inertial>
|
||||||
<visual>
|
<visual>
|
||||||
<origin rpy="0 1.57079 0" xyz="0 0 0"/>
|
<origin rpy="0 1.57079 0" xyz="0 0 0"/>
|
||||||
@ -362,7 +362,7 @@
|
|||||||
<inertial>
|
<inertial>
|
||||||
<origin rpy="0 0 0" xyz="-.02 0 0"/>
|
<origin rpy="0 0 0" xyz="-.02 0 0"/>
|
||||||
<mass value="1.095"/>
|
<mass value="1.095"/>
|
||||||
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
|
<inertia ixx="0.002" ixy="0" ixz="0" iyy="0.002" iyz="0" izz="0.001"/>
|
||||||
</inertial>
|
</inertial>
|
||||||
<visual>
|
<visual>
|
||||||
<origin rpy="0 0 0" xyz="0 0 0"/>
|
<origin rpy="0 0 0" xyz="0 0 0"/>
|
||||||
@ -398,7 +398,7 @@
|
|||||||
<inertial>
|
<inertial>
|
||||||
<origin rpy="0 0 0" xyz="0 -0.04 -0.04"/>
|
<origin rpy="0 0 0" xyz="0 -0.04 -0.04"/>
|
||||||
<mass value="1.527"/>
|
<mass value="1.527"/>
|
||||||
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
|
<inertia ixx="0.016" ixy="0" ixz="0" iyy="0.007" iyz="0" izz="0.011"/>
|
||||||
</inertial>
|
</inertial>
|
||||||
<visual>
|
<visual>
|
||||||
<origin rpy="0 0 0" xyz="0 0 0"/>
|
<origin rpy="0 0 0" xyz="0 0 0"/>
|
||||||
@ -435,7 +435,7 @@
|
|||||||
<inertial>
|
<inertial>
|
||||||
<origin rpy="0 0 0" xyz="0 -0.16 -0.02"/>
|
<origin rpy="0 0 0" xyz="0 -0.16 -0.02"/>
|
||||||
<mass value="0.241"/>
|
<mass value="0.241"/>
|
||||||
<inertia ixx="0" ixy="0" ixz="0" iyy="0" iyz="0" izz="0"/>
|
<inertia ixx="0.002" ixy="0" ixz="0" iyy="0.002" iyz="0" izz="0.002"/>
|
||||||
</inertial>
|
</inertial>
|
||||||
<visual>
|
<visual>
|
||||||
<origin rpy="0 1.57079 0" xyz="0 0 0"/>
|
<origin rpy="0 1.57079 0" xyz="0 0 0"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user