From 5984e9b728efbe2d4dfd2fd79e9afec2f93006e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9goire=20Passault?= Date: Fri, 19 Apr 2024 10:10:02 +0200 Subject: [PATCH] Adding -n flag to ignore self collisions when using bullet helper --- onshape_to_robot/bullet.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/onshape_to_robot/bullet.py b/onshape_to_robot/bullet.py index c35afce..88503c6 100644 --- a/onshape_to_robot/bullet.py +++ b/onshape_to_robot/bullet.py @@ -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) @@ -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)