fiexd URDF generation
This commit is contained in:
parent
d27f2fb762
commit
ca54b3f05a
2 changed files with 9 additions and 10 deletions
|
@ -1,15 +1,13 @@
|
|||
import argparse
|
||||
|
||||
from usecases.stability_check_usecase import StabilityCheckUseCase
|
||||
|
||||
#python3 main.py --aspPath /home/idontsudo/t/framework/asp/out/sdf-generation --buildNumber 3
|
||||
# python3 main.py --aspPath /home/idontsudo/t/framework/cad_generation/out/sdf-generation/ --buildNumber 2
|
||||
def main():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--aspPath', help='asp folder generation path')
|
||||
parser.add_argument('--buildNumber', help='FreeCad generation buildNumber')
|
||||
args = parser.parse_args()
|
||||
# args.aspPath
|
||||
# args.buildNumber
|
||||
|
||||
StabilityCheckUseCase().call( args.aspPath,args.buildNumber )
|
||||
|
||||
|
||||
|
|
|
@ -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