Commit Graph

43 Commits

Author SHA1 Message Date
William Tambellini
3726c72d11 Fix warning in examples/Utils/ChromeTraceUtil.cpp
Fix warning in examples/Utils/ChromeTraceUtil.cpp :
bullet3/examples/Utils/ChromeTraceUtil.cpp:122:62: warning:
format ‘%lu’ expects argument of type ‘long unsigned int’,
but argument 4 has type ‘long long unsigned int’ [-Wformat=]:
for startTimeDiv1000, ...
Tested:
- examples/ExampleBrowser/App_ExampleBrowser --tracing
- press the P key to write the profiler json file
- head /tmp/timings_0.json
- open /tmp/timings_0.json with chrome://tracing
2020-08-07 17:38:42 -07:00
Erwin Coumans
39a4e8dcd9 Implement faster array versions of PyBullet: getJointStatesMultiDof, getLinkStates, setJointMotorControlMultiDofArray, resetJointStatesMultiDof,
Implement StablePD in C++ through setJointMotorControlMultiDofArray method for pybullet_envs.deep_mimic, see testHumanoid.py and examples/pybullet/examples/humanoidMotionCapture.py
Minor fix in ChromeTraceUtil in case startTime>endTime (why would it happen?)
2019-07-21 13:08:22 -07:00
erwincoumans
f9f8d0fbb0 example for fileIOPlugin.py loading SDF and its assets from a single zipfile,
also show how to disable file caching (used in the fileIOPlugin)
2018-11-17 14:11:01 -08:00
erwincoumans
750133694c Disable btQuickprof.h profiling by default. We use custom profiling functions, see b3ChromeUtilsStartTimings. 2018-11-01 08:19:50 -07:00
Erwin Coumans
2fa0ae9349 fix sprintf using nullptr string 2018-10-29 13:45:42 -07:00
erwincoumans
078887c4d7 PyBullet fileIOPlugin: don't add equal fileIO interface twice (based on identical fileIOType and pathPrefix)
loadBullet goes through fileIOPlugin
2018-10-29 10:25:40 -07:00
erwincoumans
c1e20c448f Implement InMemoryFile for memory caching for fileIO plugin.
Support SDF loading through fileIO plugin.
Replace strcspn by C code (not crossplatform)
Add flag for loadURDF to use color from MTL file (instead from URDF link material)
pybullet.URDF_USE_MATERIAL_COLORS_FROM_MTL and pybullet.URDF_USE_MATERIAL_TRANSPARANCY_FROM_MTL
2018-10-14 12:54:34 -07:00
erwincoumans
3309ce8f6a strip \r \n from line 2018-10-13 16:23:58 -07:00
erwincoumans
dba239fe8d First pass of load files through an interface (to allow loading from memory, zip file etc). So instead of posix fopen/fread, using CommonFileIOInterface.
A fileIO plugin can override custom file IO operations. As a small test, load files from a zipfile in memory.
Default fileIO implementation is in examples/Utils/b3BulletDefaultFileIO.h
Affects URDF, SDF, MJCF, Wavefront OBJ, STL, DAE, images.
2018-10-08 21:27:08 -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
Erwin Coumans
2cab56d6ef prepare build system(s) for collisionFilterPlugin 2018-07-27 15:48:24 +02:00
Erwin Coumans
1569f3845c more fixes in pybullet_gym envs/data.
implement pybullet.setAdditionalSearchPath
2017-08-27 19:34:00 -07:00
Erwin Coumans
0df8887990 improve pybullet performance of loadURDF/SDF/MJCF and 'createCollisionShape'/'createMultiBody' for GUI/VR/SHARED_MEMORY,
use p.configureDebugVisualizer(p.COV_ENABLE_RENDERING,0) before loading and
p.configureDebugVisualizer(p.COV_ENABLE_RENDERING,1) afterwards
2017-07-14 23:12:16 +01:00
erwincoumans
518c7ec00e Merge pull request #1144 from lunkhound/pr-threading-refactor
Bullet 2 threading refactor: moved parallel-for calls into core libs
2017-06-02 16:18:12 -07:00
Erwin Coumans
8ef3a60f1c compile fix 2017-06-02 09:01:50 -07:00
Erwin Coumans
5a89b4f385 allow b3Clock to reset to time reference 0, by default reset will set the reference to 'now'. 2017-06-02 08:18:17 -07:00
Erwin Coumans
87293e835c implement specular, URDF non-standard specular part (see sphere2.urdf) and SDF specular support.
pybullet.changeVisualShape(obUid,linkIndex,specularColor=[R,G,B]) and Bullet C-API b3UpdateVisualShapeSpecularColor
Bug fixes in b3ResourcePath::findResourcePath resolution.
add stadium.sdf and roboschool/models_outdoor/stadium assets https://github.com/openai/roboschool/tree/master/roboschool/models_outdoor/stadium
minor fixes to obj2sdf
2017-06-01 12:32:44 -07:00
Lunkhound
ba88d332fb fix crash with out of range thread index 2017-05-29 23:54:15 -07:00
Erwin Coumans
ef7a7f9004 Potential fix for Linux slow performance (usleep(0) takes a lot of time)
Remove b3RobotSimAPI, use RobotSimulator/b3RobotSimulatorClientAPI.h instead
2017-05-13 13:37:49 -07:00
Erwin Coumans
1f64a87abe Improve ChromeTraceUtil logging, allow filename to be specified.
Expose this ChromeTraceUtil  logging to C-API: start/statelogging and submitProfileTiming
pybullet.submitProfileTiming, and STATE_LOGGING_PROFILE_TIMINGS used in startStateLogging
added example for Python profileTiming.py and C++ b3RobotSimulatorClientAPI::submitProfileTiming
2017-05-04 17:51:40 -07:00
Erwin Coumans
9fef6c1d66 Add C++ version VRGloveSimulatorMain example, using the serial library.
First run the App_PhysicsServer_SharedMemory_VR_vs2010.exe to run the VR server,
then run App_VRGloveHandSimulator. You likely need to tune the minV/maxV for each finger (check values using Arduino IDE Serial Monitor)
2017-05-01 22:35:33 -07:00
Erwin Coumans
af6bf8ddc8 plumb URDF/SDF audio_source into PhysicsServerCommandProcessor, allow to play sounds on collision !
See also https://youtu.be/eppOjTfx5Jg for a first test, and this modified URDF how to add sounds:
https://github.com/bulletphysics/bullet3/blob/master/data/plane_with_collision_audio.urdf
Add the --audio flag to enable sound in pybullet/Bullet-C-API
2017-05-01 11:14:09 -07:00
Erwin Coumans
5158c1ae98 add python dumpLog.py utility to view log files created using 'startStateLogging'
don't enable <CTRL> for hotkeys yet
add some more profile markers
log objectId and linkIndex as signed int ('i') and not unsigned int 'I'
fix issue in startStateLogging: number of parameters was wrong
2017-04-12 15:02:47 -07:00
Erwin Coumans
0e8bc418d7 add utility for reading and writing of minitaur quadruped robot log files.
Example usage:
const char* fileName = "D:/LOG00053.TXT";
btAlignedObjectArray<MinitaurLogRecord> logRecords;
btAlignedObjectArray<std::string> structNames;
std::string structTypes;
bool verbose = false;
//reading
int val = readMinitaurLogFile(fileName, structNames, structTypes,
logRecords, verbose);

//writing
const char* fileNameOut = "D:/LOG00100.TXT";
FILE* f = createMinitaurLogFile(fileNameOut,structNames,structTypes);
for (int i=0;i<logRecords.size();i++)
{
  appendMinitaurLogData(f, structTypes, logRecords[i]);
}
closeMinitaurLogFile(f);
2017-02-09 09:48:50 -08:00
erwincoumans
26a34e3cda Move ChromeTracing in its own file, and add tracing support for VR server (App_SharedMemoryPhysics_VR)
Add a bit of extra sleep in PhysicsServer thread, to make rendering smoother.
2017-01-29 20:59:47 -08:00
Erwin Coumans
5e6cfd70b5 iOS platform and Android don't have __thread local storage, so avoid multi-threaded profiler on those (only on _WIN32, __linux__ and __APPLE__ and not TARGET_OS_IPHONE
Add a Sleep(0) for Windows to yield threads (and not Sleep(1))
2017-01-08 12:49:04 -08:00
Erwin Coumans
4c06fd27b3 Example Browser: add option (keypress 'p') to dump json timing profile trace, that you can open using Chrome about://tracing
Make btQuickprof thread safe
Add option in btQuickprof to override custom timing profile (btSetCustomEnterProfileZoneFunc, btSetCustomLeaveProfileZoneFunc)
remove b3Printf in a user/physics thread (those added added, while drawing the GUI running in the main thread)
2016-12-23 15:20:04 -08:00
erwincoumans
c481662938 Merge pull request #723 from benelot/3D-NN-walkers-example
Simple Neural Network 3D Walkers example
2016-10-21 08:47:35 -07:00
Benjamin Ellenberger
134c788f93 Change all btVector/btTransform to const btVector/btTransform& for SIMD alignment. 2016-10-19 18:35:01 +02:00
Benelot
f0f694145d Implement TimeWarpBase.
-------------------------------------
This commit implements speeding up and slowing down examples. The
example can be influenced by the parameters. A separate example will be
added to show off the capabilities of the TimeWarpBase for other
examples. 

The walkers work quite well, a successful evolution was run over night
and reached a walker distance of 7.2m.
2016-09-16 09:49:18 +02:00
Benelot
88edbf8524 Implement basic evoluationary algorithm. 2016-09-11 22:25:22 +02:00
Erwin Coumans
ab8f498d18 avoid infinite recursion in b3Clock::usleep 2016-08-18 13:44:04 -07:00
Erwin Coumans
985a6c203f fix typo 2016-08-13 12:38:40 -07:00
erwin coumans
3bdcf23a05 Add sleep to avoid 100% busy CPU loop in PhysicsServerExample
Added btClock::usleep
Fix broken TinyRenderer example code.
2016-08-13 12:21:18 -07:00
erwin coumans
c28cd03fbd OpenVR controller can pick/drag objects. Instructions, Windows only:
Compile using premake+visual studio, and compile App_SharedMemoryPhysics_VR
Compile pybullet using cmake using cmake -DBUILD_PYBULLET=OFF -DCMAKE_BUILD_TYPE=Release ..
Create a symbolic link from c:\python\dlls\pybullet.pyd to C:\develop\bullet3\cmp\lib\Release\pybullet.dll
App_SharedMemoryPhysics_VR
Run Python. Here are some Python lines to get going:
import pybullet as p
p.connect(p.SHARED_MEMORY)
p.loadURDF("cube.urdf")
p.setGravity(0,0,-10)
p.setRealTimeSimulation(1)

Allow real-time simulation in physics server, add pybullet command setRealTimeSimulation to control it
Mesh decimation (reduce number of triangles/vertices) using a Blender modifier for Kuka IIWA and Husky
Disabled the 'glFlush' commands in GLInstancingRenderer.
Add VR controller methods to examples\CommonInterfaces\CommonExampleInterface.h
Use the ANSI version in Windows file/string operations instead of unicode, hope this doesn't break builds.
2016-07-17 23:50:11 -07:00
erwincoumans
81ae53e3a4 Merge pull request #683 from erwincoumans/master
VR support in PhysicsServerExample, physics runs in its own thread.
2016-07-09 15:24:40 -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
Brigham Keys, Esq
06d6c9fc3a There was a typo I came across when cross compiling
TLDR; I fixed a typo for the windows build.
 - bkeys
2016-07-08 16:30:01 -05:00
Erwin Coumans
251fab0d75 expand b3ResourcePath automagic resource localization capability. 2016-06-20 12:40:08 -07:00
erwincoumans
9be978337f quick draft implementation for SharedMemoryInProcessPhysicsC_API 2016-03-07 14:56:16 -08:00
erwincoumans
4630d0abb1 fix windows build for b3ResourcePath
replace print -> b3Printf in URDF2Bullet.cpp
2015-07-03 18:54:41 -07:00
Erwin Coumans (Google)
8517e85b21 fix various warning
add b3ResourcePath utility, to locate resources relative to executable
2015-07-03 18:17:14 -07:00
erwincoumans
a1bf9c5556 add initial examples, replacing the 'Demos/Demos3'. Will make it work cross-platform, OpenGL3/OpenGL2 and add more examples to it. 2015-04-16 09:55:32 -07:00