Merge pull request #1039 from erwincoumans/master
remove use of snprint,, better matching pr2_gripper collision model for fingers
This commit is contained in:
@@ -71,9 +71,9 @@
|
|||||||
</visual>
|
</visual>
|
||||||
<collision>
|
<collision>
|
||||||
<geometry>
|
<geometry>
|
||||||
<box size=".03 .03 .02"/>
|
<box size=".03 .01 .02"/>
|
||||||
</geometry>
|
</geometry>
|
||||||
<origin rpy="0.0 0 0" xyz="0.105 0.00495 0"/>
|
<origin rpy="0.0 0.0 0" xyz="0.105 -0.005 0"/>
|
||||||
</collision>
|
</collision>
|
||||||
<inertial>
|
<inertial>
|
||||||
<mass value="0.1"/>
|
<mass value="0.1"/>
|
||||||
@@ -130,10 +130,17 @@
|
|||||||
</visual>
|
</visual>
|
||||||
<collision>
|
<collision>
|
||||||
<geometry>
|
<geometry>
|
||||||
<box size=".03 .03 .02"/>
|
<box size=".03 .01 .02"/>
|
||||||
</geometry>
|
</geometry>
|
||||||
<origin rpy="-3.1415 0 0" xyz="0.105 0.00495 0"/>
|
<origin rpy="-3.1415 0 0" xyz="0.105 0.015 0"/>
|
||||||
</collision>
|
</collision>
|
||||||
|
<collision>
|
||||||
|
<geometry>
|
||||||
|
<box size=".01 .02 .02"/>
|
||||||
|
</geometry>
|
||||||
|
<origin rpy="-3.1415 0 -0.5" xyz="0.095 0.005 0"/>
|
||||||
|
</collision>
|
||||||
|
|
||||||
<inertial>
|
<inertial>
|
||||||
<mass value="0.1"/>
|
<mass value="0.1"/>
|
||||||
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
|
<inertia ixx="1.0" ixy="0.0" ixz="0.0" iyy="1.0" iyz="0.0" izz="1.0"/>
|
||||||
|
|||||||
@@ -1,5 +1,3 @@
|
|||||||
|
|
||||||
|
|
||||||
#include "OpenGLExampleBrowser.h"
|
#include "OpenGLExampleBrowser.h"
|
||||||
|
|
||||||
#include "Bullet3Common/b3CommandLineArgs.h"
|
#include "Bullet3Common/b3CommandLineArgs.h"
|
||||||
|
|||||||
@@ -173,9 +173,17 @@ struct BulletMJCFImporterInternalData
|
|||||||
|
|
||||||
std::string sourceFileLocation(TiXmlElement* e)
|
std::string sourceFileLocation(TiXmlElement* e)
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
|
//no C++11 snprintf etc
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
snprintf(buf, sizeof(buf), "%s:%i", m_sourceFileName.c_str(), e->Row());
|
snprintf(buf, sizeof(buf), "%s:%i", m_sourceFileName.c_str(), e->Row());
|
||||||
return buf;
|
return buf;
|
||||||
|
#else
|
||||||
|
char row[1024];
|
||||||
|
sprintf(row,"%d",e->Row());
|
||||||
|
std::string str = m_sourceFileName.c_str() + std::string(":") + std::string(row);
|
||||||
|
return str;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
const UrdfLink* getLink(int modelIndex, int linkIndex) const
|
const UrdfLink* getLink(int modelIndex, int linkIndex) const
|
||||||
|
|||||||
@@ -1679,7 +1679,17 @@ bool UrdfParser::loadSDF(const char* sdfText, ErrorLogger* logger)
|
|||||||
|
|
||||||
std::string UrdfParser::sourceFileLocation(TiXmlElement* e)
|
std::string UrdfParser::sourceFileLocation(TiXmlElement* e)
|
||||||
{
|
{
|
||||||
|
#if 0
|
||||||
|
//no C++11 etc, no snprintf
|
||||||
|
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
snprintf(buf, sizeof(buf), "%s:%i", m_urdf2Model.m_sourceFile.c_str(), e->Row());
|
snprintf(buf, sizeof(buf), "%s:%i", m_urdf2Model.m_sourceFile.c_str(), e->Row());
|
||||||
return buf;
|
return buf;
|
||||||
|
#else
|
||||||
|
char row[1024];
|
||||||
|
sprintf(row,"%d",e->Row());
|
||||||
|
std::string str = m_urdf2Model.m_sourceFile.c_str() + std::string(":") + std::string(row);
|
||||||
|
return str;
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -305,6 +305,7 @@ void MotionThreadFunc(void* userPtr,void* lsMemory)
|
|||||||
|
|
||||||
double deltaTimeInSeconds = 0;
|
double deltaTimeInSeconds = 0;
|
||||||
int numCmdSinceSleep1ms = 0;
|
int numCmdSinceSleep1ms = 0;
|
||||||
|
unsigned long long int prevTime = clock.getTimeMicroseconds();
|
||||||
|
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
@@ -330,8 +331,16 @@ void MotionThreadFunc(void* userPtr,void* lsMemory)
|
|||||||
sleepClock.reset();
|
sleepClock.reset();
|
||||||
numCmdSinceSleep1ms = 0;
|
numCmdSinceSleep1ms = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned long long int curTime = clock.getTimeMicroseconds();
|
||||||
|
unsigned long long int dtMicro = curTime - prevTime;
|
||||||
|
prevTime = curTime;
|
||||||
|
#if 1
|
||||||
|
double dt = double(dtMicro)/1000000.;
|
||||||
|
#else
|
||||||
double dt = double(clock.getTimeMicroseconds())/1000000.;
|
double dt = double(clock.getTimeMicroseconds())/1000000.;
|
||||||
clock.reset();
|
clock.reset();
|
||||||
|
#endif
|
||||||
deltaTimeInSeconds+= dt;
|
deltaTimeInSeconds+= dt;
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ btMultiBody::btMultiBody(int n_links,
|
|||||||
m_userObjectPointer(0),
|
m_userObjectPointer(0),
|
||||||
m_userIndex2(-1),
|
m_userIndex2(-1),
|
||||||
m_userIndex(-1),
|
m_userIndex(-1),
|
||||||
m_linearDamping(0.04f),
|
m_linearDamping(0.0f),
|
||||||
m_angularDamping(0.04f),
|
m_angularDamping(0.04f),
|
||||||
m_useGyroTerm(true),
|
m_useGyroTerm(true),
|
||||||
m_maxAppliedImpulse(1000.f),
|
m_maxAppliedImpulse(1000.f),
|
||||||
|
|||||||
@@ -518,7 +518,7 @@ CProfileIterator * CProfileManager::Get_Iterator( void )
|
|||||||
{
|
{
|
||||||
|
|
||||||
int threadIndex = btQuickprofGetCurrentThreadIndex2();
|
int threadIndex = btQuickprofGetCurrentThreadIndex2();
|
||||||
if (threadIndex<0)
|
if ((threadIndex<0) || threadIndex >= BT_QUICKPROF_MAX_THREAD_COUNT)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return new CProfileIterator( &gRoots[threadIndex]);
|
return new CProfileIterator( &gRoots[threadIndex]);
|
||||||
@@ -549,7 +549,7 @@ void CProfileManager::CleanupMemory(void)
|
|||||||
void CProfileManager::Start_Profile( const char * name )
|
void CProfileManager::Start_Profile( const char * name )
|
||||||
{
|
{
|
||||||
int threadIndex = btQuickprofGetCurrentThreadIndex2();
|
int threadIndex = btQuickprofGetCurrentThreadIndex2();
|
||||||
if (threadIndex<0)
|
if ((threadIndex<0) || threadIndex >= BT_QUICKPROF_MAX_THREAD_COUNT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (name != gCurrentNodes[threadIndex]->Get_Name()) {
|
if (name != gCurrentNodes[threadIndex]->Get_Name()) {
|
||||||
@@ -566,7 +566,7 @@ void CProfileManager::Start_Profile( const char * name )
|
|||||||
void CProfileManager::Stop_Profile( void )
|
void CProfileManager::Stop_Profile( void )
|
||||||
{
|
{
|
||||||
int threadIndex = btQuickprofGetCurrentThreadIndex2();
|
int threadIndex = btQuickprofGetCurrentThreadIndex2();
|
||||||
if (threadIndex<0)
|
if ((threadIndex<0) || threadIndex >= BT_QUICKPROF_MAX_THREAD_COUNT)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Return will indicate whether we should back up to our parent (we may
|
// Return will indicate whether we should back up to our parent (we may
|
||||||
@@ -590,7 +590,7 @@ void CProfileManager::Reset( void )
|
|||||||
{
|
{
|
||||||
gProfileClock.reset();
|
gProfileClock.reset();
|
||||||
int threadIndex = btQuickprofGetCurrentThreadIndex2();
|
int threadIndex = btQuickprofGetCurrentThreadIndex2();
|
||||||
if (threadIndex<0)
|
if ((threadIndex<0) || threadIndex >= BT_QUICKPROF_MAX_THREAD_COUNT)
|
||||||
return;
|
return;
|
||||||
gRoots[threadIndex].Reset();
|
gRoots[threadIndex].Reset();
|
||||||
gRoots[threadIndex].Call();
|
gRoots[threadIndex].Call();
|
||||||
|
|||||||
@@ -3,5 +3,5 @@ IF(BUILD_BULLET3)
|
|||||||
SUBDIRS( InverseDynamics SharedMemory )
|
SUBDIRS( InverseDynamics SharedMemory )
|
||||||
ENDIF(BUILD_BULLET3)
|
ENDIF(BUILD_BULLET3)
|
||||||
|
|
||||||
SUBDIRS( gtest-1.7.0 collision RobotLogging BulletDynamics )
|
SUBDIRS( gtest-1.7.0 collision BulletDynamics )
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user