From e286fbd9f29b018b30963411c137ab8d15bcddb0 Mon Sep 17 00:00:00 2001 From: Erwin Coumans Date: Sat, 15 Jun 2019 10:30:48 -0700 Subject: [PATCH] fixes for RemoteGUIHelper --- examples/ExampleBrowser/CMakeLists.txt | 8 ++++++++ examples/RobotSimulator/CMakeLists.txt | 8 ++++++++ examples/SharedMemory/RemoteGUIHelper.cpp | 2 +- examples/TwoJoint/CMakeLists.txt | 8 ++++++++ examples/pybullet/CMakeLists.txt | 8 ++++++++ examples/pybullet/examples/inverse_kinematics.py | 16 ++++++++-------- 6 files changed, 41 insertions(+), 9 deletions(-) diff --git a/examples/ExampleBrowser/CMakeLists.txt b/examples/ExampleBrowser/CMakeLists.txt index d17ed4210..a04e9f9b4 100644 --- a/examples/ExampleBrowser/CMakeLists.txt +++ b/examples/ExampleBrowser/CMakeLists.txt @@ -171,6 +171,14 @@ SET(BulletExampleBrowser_SRCS ../SharedMemory/PhysicsClientSharedMemory_C_API.cpp ../SharedMemory/PhysicsClient.cpp ../SharedMemory/PhysicsClientC_API.cpp + ../SharedMemory/GraphicsServerExample.cpp + ../SharedMemory/GraphicsClientExample.cpp + ../SharedMemory/RemoteGUIHelper.cpp + ../SharedMemory/GraphicsServerExample.h + ../SharedMemory/GraphicsClientExample.h + ../SharedMemory/RemoteGUIHelper.h + ../SharedMemory/GraphicsSharedMemoryCommands.h + ../SharedMemory/GraphicsSharedMemoryPublic.h ../SharedMemory/PhysicsServerExample.cpp ../SharedMemory/PhysicsServerExampleBullet2.cpp ../SharedMemory/PhysicsClientExample.cpp diff --git a/examples/RobotSimulator/CMakeLists.txt b/examples/RobotSimulator/CMakeLists.txt index 6a0553a76..8f0194caf 100644 --- a/examples/RobotSimulator/CMakeLists.txt +++ b/examples/RobotSimulator/CMakeLists.txt @@ -15,6 +15,14 @@ RobotSimulatorMain.cpp MinitaurSetup.cpp MinitaurSetup.h ../../examples/ExampleBrowser/InProcessExampleBrowser.cpp + ../SharedMemory/GraphicsServerExample.cpp + ../SharedMemory/GraphicsClientExample.cpp + ../SharedMemory/RemoteGUIHelper.cpp + ../SharedMemory/GraphicsServerExample.h + ../SharedMemory/GraphicsClientExample.h + ../SharedMemory/RemoteGUIHelper.h + ../SharedMemory/GraphicsSharedMemoryCommands.h + ../SharedMemory/GraphicsSharedMemoryPublic.h ../../examples/SharedMemory/PhysicsServerExample.cpp ../../examples/SharedMemory/PhysicsServerExampleBullet2.cpp ../../examples/SharedMemory/SharedMemoryInProcessPhysicsC_API.cpp diff --git a/examples/SharedMemory/RemoteGUIHelper.cpp b/examples/SharedMemory/RemoteGUIHelper.cpp index 079bee2f6..3c71a772f 100644 --- a/examples/SharedMemory/RemoteGUIHelper.cpp +++ b/examples/SharedMemory/RemoteGUIHelper.cpp @@ -363,7 +363,7 @@ int RemoteGUIHelper::uploadData(const unsigned char* data, int sizeInBytes, int { for (int i = 0; i < curBytes; i++) { - m_data->m_testBlock1->m_bulletStreamData[i] = data[i]; + m_data->m_testBlock1->m_bulletStreamData[i] = data[i+offset]; } cmd->m_updateFlags = 0; diff --git a/examples/TwoJoint/CMakeLists.txt b/examples/TwoJoint/CMakeLists.txt index a596ab404..6069d58b5 100644 --- a/examples/TwoJoint/CMakeLists.txt +++ b/examples/TwoJoint/CMakeLists.txt @@ -32,6 +32,14 @@ SET(RobotSimulator_SRCS ../../examples/SharedMemory/PhysicsClient.h ../../examples/SharedMemory/PhysicsServer.cpp ../../examples/SharedMemory/PhysicsServer.h + ../SharedMemory/GraphicsServerExample.cpp + ../SharedMemory/GraphicsClientExample.cpp + ../SharedMemory/RemoteGUIHelper.cpp + ../SharedMemory/GraphicsServerExample.h + ../SharedMemory/GraphicsClientExample.h + ../SharedMemory/RemoteGUIHelper.h + ../SharedMemory/GraphicsSharedMemoryCommands.h + ../SharedMemory/GraphicsSharedMemoryPublic.h ../../examples/SharedMemory/PhysicsServerExample.cpp ../../examples/SharedMemory/PhysicsServerExampleBullet2.cpp ../../examples/SharedMemory/SharedMemoryInProcessPhysicsC_API.cpp diff --git a/examples/pybullet/CMakeLists.txt b/examples/pybullet/CMakeLists.txt index 1b791ec7e..229b67245 100644 --- a/examples/pybullet/CMakeLists.txt +++ b/examples/pybullet/CMakeLists.txt @@ -55,6 +55,14 @@ SET(pybullet_SRCS ../../examples/SharedMemory/PhysicsClient.h ../../examples/SharedMemory/PhysicsServer.cpp ../../examples/SharedMemory/PhysicsServer.h + ../SharedMemory/GraphicsServerExample.cpp + ../SharedMemory/GraphicsClientExample.cpp + ../SharedMemory/RemoteGUIHelper.cpp + ../SharedMemory/GraphicsServerExample.h + ../SharedMemory/GraphicsClientExample.h + ../SharedMemory/RemoteGUIHelper.h + ../SharedMemory/GraphicsSharedMemoryCommands.h + ../SharedMemory/GraphicsSharedMemoryPublic.h ../../examples/SharedMemory/PhysicsServerExample.cpp ../../examples/SharedMemory/PhysicsServerExampleBullet2.cpp ../../examples/SharedMemory/SharedMemoryInProcessPhysicsC_API.cpp diff --git a/examples/pybullet/examples/inverse_kinematics.py b/examples/pybullet/examples/inverse_kinematics.py index 235350765..803280b0d 100644 --- a/examples/pybullet/examples/inverse_kinematics.py +++ b/examples/pybullet/examples/inverse_kinematics.py @@ -40,8 +40,8 @@ useNullSpace = 1 useOrientation = 1 #If we set useSimulation=0, it sets the arm pose to be the IK result directly without using dynamic control. #This can be used to test the IK result accuracy. -useSimulation = 0 -useRealTimeSimulation = 1 +useSimulation = 1 +useRealTimeSimulation = 0 ikSolver = 0 p.setRealTimeSimulation(useRealTimeSimulation) #trailDuration is duration (in seconds) after debug lines will be removed automatically @@ -49,17 +49,17 @@ p.setRealTimeSimulation(useRealTimeSimulation) trailDuration = 15 i=0 -while i<5: +while 1: i+=1 - p.getCameraImage(320, - 200, - flags=p.ER_SEGMENTATION_MASK_OBJECT_AND_LINKINDEX, - renderer=p.ER_BULLET_HARDWARE_OPENGL) + #p.getCameraImage(320, + # 200, + # flags=p.ER_SEGMENTATION_MASK_OBJECT_AND_LINKINDEX, + # renderer=p.ER_BULLET_HARDWARE_OPENGL) if (useRealTimeSimulation): dt = datetime.now() t = (dt.second / 60.) * 2. * math.pi else: - t = t + 0.001 + t = t + 0.01 if (useSimulation and useRealTimeSimulation == 0): p.stepSimulation()