fiexd URDF generation
This commit is contained in:
parent
d27f2fb762
commit
ca54b3f05a
2 changed files with 9 additions and 10 deletions
|
@ -7,16 +7,17 @@ import json
|
|||
|
||||
|
||||
class StabilityCheckUseCase:
|
||||
def call(self, outPath: str, buildNumber: int, duration=500):
|
||||
def call(self, outPath: str, buildNumber: int, duration=10000):
|
||||
DURATION = duration
|
||||
try:
|
||||
assemblyUrdf = json.loads(
|
||||
(open(outPath + 'urdf-generation.json')).read()).get(buildNumber)
|
||||
except:
|
||||
print(assemblyUrdf)
|
||||
except Exception as e:
|
||||
print(e)
|
||||
return TypeError('not found urfd file or not found build number')
|
||||
inc = 0
|
||||
urdfs = []
|
||||
|
||||
for el in assemblyUrdf:
|
||||
inc += 1
|
||||
file_to_open = outPath + str(inc) + '.urdf'
|
||||
|
@ -26,15 +27,15 @@ class StabilityCheckUseCase:
|
|||
f.write(el)
|
||||
urdfs.append(os.path.abspath(f.name))
|
||||
f.close()
|
||||
|
||||
p.connect(p.DIRECT)
|
||||
p.connect(p.GUI)
|
||||
|
||||
p.setGravity(0, 0, -10)
|
||||
p.setAdditionalSearchPath(pybullet_data.getDataPath())
|
||||
|
||||
bulletIds = []
|
||||
p.loadURDF("plane.urdf")
|
||||
for el in urdfs:
|
||||
bulletIds.append(p.loadURDF(el))
|
||||
p.loadURDF("plane.urdf")
|
||||
resultCoords = []
|
||||
for i in range(DURATION):
|
||||
if (i + 200 == DURATION):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue