Skip to content

Commit

Permalink
Adding -n flag to ignore self collisions when using bullet helper
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregwar committed Apr 19, 2024
1 parent bd994b1 commit 5984e9b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion onshape_to_robot/bullet.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
def main():
parser = argparse.ArgumentParser(prog="onshape-to-robot-bullet")
parser.add_argument('-f', '--fixed', action='store_true')
parser.add_argument('-n', '--no-self-collisions', action='store_true')
parser.add_argument('-x', '--x', type=float, default=0)
parser.add_argument('-y', '--y', type=float, default=0)
parser.add_argument('-z', '--z', type=float, default=0)
Expand All @@ -20,7 +21,7 @@ def main():
if not robotPath.endswith('.urdf'):
robotPath += '/robot.urdf'

sim = Simulation(robotPath, gui=True, panels=True, fixed=args.fixed)
sim = Simulation(robotPath, gui=True, panels=True, fixed=args.fixed, ignore_self_collisions=args.no_self_collisions)
pos, rpy = sim.getRobotPose()
_, orn = p.getBasePositionAndOrientation(sim.robot)
sim.setRobotPose([pos[0] + args.x, pos[1] + args.y, pos[2] + args.z], orn)
Expand Down

0 comments on commit 5984e9b

Please sign in to comment.