Commit Graph

52 Commits

Author SHA1 Message Date
vabr-g
390eeb111b
Fix stack overflow in parsing URDF files in Bullet
When reading response from the Bullet server after a "load URDF" command, the client code allocated and zeroed buffers for the data chunks with a "+1" to account for the terminating zero. This was when the buffer pointer was interpreted as a `char *`, so it meant "+ 1 byte".

When reading those buffers, however, the associated pointer was a `void *`, so reading `sizeof(void*)` (8 on my machine) bytes at a time. Therefore it was reading up to 7 bytes past the allocated (and zeroed) memory.

The change fixes that by changing the "+ 1" to "+ sizeof(void*)". At one place it also extends the zeroing to the final buffer position (missing "+ 1" in the original).
2021-03-02 11:55:19 +01:00
erwincoumans
671668f6c8
Update DNA_rigidbody.h 2021-02-08 07:52:54 -08:00
Erwin Coumans
e454b90c5b bump up PyBullet and Bullet version to 3.05 (in sync for this release) 2020-09-24 10:11:37 -07:00
Erwin Coumans
5a9b862ef5 bump up to Bullet version 2.89 and update serialization structures 2019-10-30 10:32:14 -07:00
Erwin Coumans
51fba6f78d export btHeightfieldTerrainShape to PyBullet. Note that tinyrenderer doesn't support rendering it (it would be too slow on CPU)
fix rare getKeyboardEvents threading issue
change texture color to default plane.urdf blue
2019-07-29 20:23:38 -07:00
Erwin Coumans
ef9570c315 add yapf style and apply yapf to format all Python files
This recreates pull request #2192
2019-04-27 07:31:15 -07:00
erwincoumans
c80e2816ad PyBullet: Use fileIOPlugin in processRestoreStateCommand
PyBullet: Report debug information in case of failure in restoreState.
2018-10-29 12:08:34 -07:00
erwincoumans
126537bd93 pybullet: fix issue with loadBullet command 2018-10-28 19:51:01 -07:00
erwincoumans
ab8f16961e Code-style consistency improvement:
Apply clang-format-all.sh using the _clang-format file through all the cpp/.h files.
make sure not to apply it to certain serialization structures, since some parser expects the * as part of the name, instead of type.
This commit contains no other changes aside from adding and applying clang-format-all.sh
2018-09-23 14:17:31 -07:00
nbelakovski
e6a5ff7d5a
Fixing include line of btMultibodyWorldImporter.h to work with installed bullet files
When running make install for Bullet, no "Extras/" folder is created, so the include line as is will fail. This modification should work since the relevant header is in the same folder as this header.
2018-04-17 11:59:04 -07:00
erwincoumans
dbb0318782 fixes related to tinyxml2 2018-04-12 12:46:43 -07:00
erwincoumans
9c77e07494 upgrade from tinyxml to tinyxml2 2018-04-12 00:09:44 -07:00
Alexey Anikeenko
feaa21e33c Fix import of spherical joint state
Spherical joints in btMultiBody have 4 positional variables.
2018-03-05 01:33:15 +07:00
Erwin Coumans
77ddc8a16f fix makesdna on Mac OSX 2018-02-14 15:41:10 -08:00
Erwin Coumans
508550c5e9 fix premake build for linux, thanks to @consultit
See also issue #1538
2018-02-09 18:46:26 -08:00
erwincoumans
c4b1b84687 Enable 'global absolute velocities' by default for btMultiBody. See 8.3.2B Proposed resolution Jakub Stepien PhD Thesis
https://drive.google.com/file/d/0Bz3vEa19XOYGNWdZWGpMdUdqVmZ5ZVBOaEh4ZnpNaUxxZFNV/view?usp=sharing
Fixes crashes due to rendering of softbody wireframe in the wrong thread (needs to be in 'debug' rendering section)
Use btCapsuleShapeZ instead of btMultiSphereShape when converting MJCF MuJoCo capsules using fromto
2018-01-09 22:47:56 -08:00
Erwin Coumans
e97b751781 further work on urdfEditor.py, fix some serialization issues 2018-01-08 12:25:56 -08:00
Erwin Coumans
35b44f8a85 implement pybullet.saveState command, for in-memory storage of state.
bump up pybullet API version (SHARED_MEMORY_MAGIC_NUMBER) to 201801010
2017-12-31 15:37:16 -08:00
Erwin Coumans
f104765c47 added some template to restore (syncMultiBody, syncContactManifolds) for single float and double precision, in 'pybullet.restoreState' 2017-12-31 11:19:29 -08:00
Erwin Coumans
20e00d11d8 further work on saveRestoreState.py 2017-12-30 21:57:42 -08:00
Erwin Coumans
0326fa93a8 made some progress in saving and restoring the state during the simulation, with identical results.
Option to de/serialize btPersistentContactManifolds and fix lossy conversion during btMultiBody de/serialization of base world transform
(serialize the quaternion, not the converted 3x3 matrix)
There are still several caches not taken into account, and btMultiBody links/constraints are not deserialized yet etc.
See examples\pybullet\examples\saveRestoreState.py for an example.
2017-12-30 14:19:13 -08:00
Erwin Coumans
22e23d22d1 double/single precision compile fix 2017-12-28 12:55:47 -08:00
Erwin Coumans
97547eda0d preliminary work towards saveState/restoreState and saveRestoreState.py example (not implemented yet)
allow multiple options in connect, for example: p.connect(p.GUI, options="--width=640, --height=480")
2017-12-28 10:05:51 -08:00
Erwin Coumans
799d030874 restore multibody world transform and joint angles/velocities from a .bullet file. 2017-12-22 14:45:36 -08:00
erwincoumans
c8f1efe7dc fix case in include 2017-11-23 09:15:19 -08:00
erwincoumans
29aa9cb789 Bullet bump up to version 2.88
add preliminary support to import btMultiBody from a .bullet file (will help save/restore state)
fix some Windows char/widechar issues
2017-11-22 18:12:02 -08:00
erwincoumans
2919e51d9d fix loading of empty file (after header)
remove debug printf
2017-09-17 15:44:14 -07:00
Erwin Coumans
c82131d16e cmake fixes 2017-09-06 14:18:35 -07:00
Erwin Coumans
7503418c72 Split Bullet/src/LinearMath/btSerializer.cpp into btSerializer64.cpp to make it easier to rebuild serialization structure.
Add several MSVC optimization flags to cmake.
Bump up VERSION because serialization format changed
Expose btScalar& jointMaxForce, btScalar& jointMaxVelocity to 'getJointInfo2' API, add backwards compatibility to examples\Importers\ImportURDFDemo\URDFImporterInterface::getJointInfo.

pybullet: expose 4 more fields to getJointInfo: jointLowerLimit/jointUpperLimit/jointMaxForce/jointMaxVelocity
fix performance issue in CMD_ACTUAL_STATE_UPDATE_COMPLETED
2017-03-26 13:06:46 -07:00
Erwin Coumans
95e25d9942 fix a few warnings 2017-01-24 08:36:46 -08:00
Erwin Coumans
93471a1c31 cmake Win32 fixes
fixed some more warnings
added alignment macros to some classes
btPersistentManifold from 128 to 16 bytes aligned
prepare command to select collision filter mode (SIM_PARAM_UPDATE_COLLISION_FILTER_MODE)
2017-01-16 13:05:26 -08:00
Erwin Coumans
c0c4c8ba3f fix many warnings
remove btMultiSapBroadphase.*
make collisionFilterGroup/collisionFilterMark int (instead of short int)
2017-01-15 22:26:11 -08:00
erwincoumans
e7cfb656c4 update bullet.h serialization header, matching the dna in Bullet/src/LinearMath/btSerialize.cpp 2016-11-05 11:36:52 -07:00
erwin coumans
c5164e503f fix in structure alignment of btMultiBodyLinkDoubleData and btMultiBodyDoubleData
causing serialization issue in  URDF/SDF loading in double-precision mode on Windows 32bit.
(it was fine on Mac/Linux 64bit)
bump serialization version to 2.85, as we change the file format
fix in name clash in makesdna.cpp -> intptr_t is already defined.
2016-08-26 10:00:29 -07:00
erwin coumans
02582e3a78 shrink down cube size of BasicDemo 10 times (it looked ginormous in VR) from 2x2x2 meter to 0.2
add test for VR HUD/sub-titles
fix issue in previous commit, partial string use %.8s not %8.s
use long long int in b3Clock
fix warning/error in pointer alignment in serialization
Fix pybullet Windows compilation.
(thanks to bkeys/https://github.com/bulletphysics/bullet3/pull/687)
2016-07-09 15:09:09 -07:00
erwincoumans
fe92de3e50 add infrastructure float btMultiBodyLink m_jointDamping, m_jointFriction (actual damping/friction is in a separate commit)
add door.urdf for testing damping/friction
2016-03-17 14:54:46 -07:00
Erwin Coumans
aa3daaa8c6 turn test/SharedMemory/test.c into a gtest for CI unit testing in github
remove overly verbose printfs in importers
fix axis in r2d2.urdf
2016-03-15 22:47:53 -07:00
Andrew Meadows
c0c1691c25 fix whitespace formatting in cmake files 2015-12-07 14:08:04 -08:00
=
4041748f55 fix warning 2015-09-14 10:45:53 -07:00
=
3d10338ed5 fix warnings (thanks to Aaron!) 2015-09-10 17:52:41 -07:00
Erwin Coumans
2721d67634 remote unused TEST macro, conflicts with other libraries 2015-08-11 08:35:52 -07:00
Erwin Coumans
26531f3fbc fix some warnings, disable gimpact by default in world importer,
use DIRECTLY_UPDATE_VELOCITY_DURING_SOLVER_ITERATIONS by default for now,
until we find the issue with some failing test cases in btMultiBody
fix a crashing issue in MyMultiBodyCreator.cpp (uninitialized variable)
disable excessive debug printf in URDF2Bullet
2015-07-27 13:28:47 -07:00
erwincoumans
6c9ce344ea fix shadowmap crash on some Intel GPUs, see https://github.com/bulletphysics/bullet3/issues/4
remove targetdir from all libraries in premake, so it is much easier to create a separate folder for all binary+lib
transmit the serialized btMultiBody data back from server to client, after the server loads a URDF file. This includes base+link+joint names
tweak the serialization routines, so it is easier to skip pointers and to serialize directly to a shared memory buffer
also tweak the serialization code to allow to process data without 'DNA' schema data (assuming file-DNA = memory DNA)
2015-07-10 22:20:06 -07:00
erwincoumans
f6f76901fd First draft of btMultiBody serialization, including optional names for base, link and joints (see ImportURDFDemo/ImportURDFSetup.cpp how this is done)
Bump up version number to 2.84 because of new serialization data.
2015-07-09 17:36:00 -07:00
Gabor Puhr
98e1334a64 Auto limitation of spring stiffness and damping in btGeneric6DofSpring2Constraint is now optional.
Fix: spring stiffness limitation used the mass incorrectly in btGeneric6DofSpring2Constraint.
2015-05-22 12:58:28 +02:00
Erwin Coumans
59b511a14e add .bullet extension in File/Open on Mac
add importer support for FIXED_CONSTRAINT_TYPE, to be replaced by btGeneric6DofSpring2Constraint
btFixedConstraint now derives from btGeneric6DofSpring2Constraint
2015-05-03 09:23:35 -07:00
erwincoumans
d50242fc27 add starting point for btGeneric6DofSpring2ConstraintData import, not all parameters are deserialized though
restore activation state after picking
add .bullet file import (only tested/available on Windows)
2015-05-01 16:27:09 -07:00
erwin coumans
6e70f285e1 fix a 64-bit issue in the optional 'preSwapFilenameOut' method (this is only use when you want to export a copy of a .bullet file after loading with a different endian-ness) 2014-12-22 14:04:19 -08:00
erwincoumans
89aeae9102 Add serialization support for btGeneric6DofSpring2Constraint
Attempt to re-order serialization data so it can be serialized in-memory (for deep copy)
2014-09-16 09:22:35 -07:00
Erwin Coumans
3c558ec995 explicitly deserialize btCapsuleShape date (margin, scaling, halfextents), because the API modifies them 2014-08-26 17:21:08 -07:00