Merge pull request #1515 from erwincoumans/master
apply a maximum velocity for the KUKA arm
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
#define PHYSICS_CLIENT_TCP_H
|
#define PHYSICS_CLIENT_TCP_H
|
||||||
|
|
||||||
#include "PhysicsDirect.h"
|
#include "PhysicsDirect.h"
|
||||||
#include "PhysicsServerCommandProcessor.h"
|
#include "PhysicsCommandProcessorInterface.h"
|
||||||
|
|
||||||
class TcpNetworkedPhysicsProcessor : public PhysicsCommandProcessorInterface
|
class TcpNetworkedPhysicsProcessor : public PhysicsCommandProcessorInterface
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
#define PHYSICS_CLIENT_UDP_H
|
#define PHYSICS_CLIENT_UDP_H
|
||||||
|
|
||||||
#include "PhysicsDirect.h"
|
#include "PhysicsDirect.h"
|
||||||
#include "PhysicsServerCommandProcessor.h"
|
#include "PhysicsCommandProcessorInterface.h"
|
||||||
|
|
||||||
class UdpNetworkedPhysicsProcessor : public PhysicsCommandProcessorInterface
|
class UdpNetworkedPhysicsProcessor : public PhysicsCommandProcessorInterface
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -12,7 +12,8 @@
|
|||||||
#include "../CommonInterfaces/CommonGUIHelperInterface.h"
|
#include "../CommonInterfaces/CommonGUIHelperInterface.h"
|
||||||
#include "SharedMemoryBlock.h"
|
#include "SharedMemoryBlock.h"
|
||||||
|
|
||||||
#include "PhysicsServerCommandProcessor.h"
|
|
||||||
|
#include "PhysicsCommandProcessorInterface.h"
|
||||||
|
|
||||||
//number of shared memory blocks == number of simultaneous connections
|
//number of shared memory blocks == number of simultaneous connections
|
||||||
#define MAX_SHARED_MEMORY_BLOCKS 2
|
#define MAX_SHARED_MEMORY_BLOCKS 2
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class Kuka:
|
|||||||
def __init__(self, urdfRootPath=pybullet_data.getDataPath(), timeStep=0.01):
|
def __init__(self, urdfRootPath=pybullet_data.getDataPath(), timeStep=0.01):
|
||||||
self.urdfRootPath = urdfRootPath
|
self.urdfRootPath = urdfRootPath
|
||||||
self.timeStep = timeStep
|
self.timeStep = timeStep
|
||||||
|
self.maxVelocity = .35
|
||||||
self.maxForce = 200.
|
self.maxForce = 200.
|
||||||
self.fingerAForce = 2
|
self.fingerAForce = 2
|
||||||
self.fingerBForce = 2.5
|
self.fingerBForce = 2.5
|
||||||
@@ -146,7 +146,7 @@ class Kuka:
|
|||||||
if (self.useSimulation):
|
if (self.useSimulation):
|
||||||
for i in range (self.kukaEndEffectorIndex+1):
|
for i in range (self.kukaEndEffectorIndex+1):
|
||||||
#print(i)
|
#print(i)
|
||||||
p.setJointMotorControl2(bodyIndex=self.kukaUid,jointIndex=i,controlMode=p.POSITION_CONTROL,targetPosition=jointPoses[i],targetVelocity=0,force=self.maxForce,positionGain=0.3,velocityGain=1)
|
p.setJointMotorControl2(bodyUniqueId=self.kukaUid,jointIndex=i,controlMode=p.POSITION_CONTROL,targetPosition=jointPoses[i],targetVelocity=0,force=self.maxForce,maxVelocity=self.maxVelocity, positionGain=0.3,velocityGain=1)
|
||||||
else:
|
else:
|
||||||
#reset the joint state (ignoring all dynamics, not recommended to use during simulation)
|
#reset the joint state (ignoring all dynamics, not recommended to use during simulation)
|
||||||
for i in range (self.numJoints):
|
for i in range (self.numJoints):
|
||||||
|
|||||||
Reference in New Issue
Block a user