From 36145374cb81ceb8a21072ce3ca3fc4239bb1d3f Mon Sep 17 00:00:00 2001 From: armlab Date: Tue, 10 Oct 2023 12:40:32 -0400 Subject: [PATCH] remove ground plane and add new script to switch to impedance mode (without moving) --- .../scripts/utility/switch_to_impedance.py | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100755 arm_robots/scripts/utility/switch_to_impedance.py diff --git a/arm_robots/scripts/utility/switch_to_impedance.py b/arm_robots/scripts/utility/switch_to_impedance.py new file mode 100755 index 0000000..a5ee41d --- /dev/null +++ b/arm_robots/scripts/utility/switch_to_impedance.py @@ -0,0 +1,24 @@ +#! /usr/bin/env python +from victor_hardware_interface_msgs.msg import ControlMode +import rospy +from arm_robots.victor import Victor +import sys +import argparse + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--left", action="store_true") + parser.add_argument("--right", action="store_true") + args = parser.parse_args(rospy.myargv(sys.argv[1:])) + + rospy.init_node("switch_to_impedance") + + victor = Victor(robot_namespace='victor') + victor.connect() + + if args.left: + print("left") + victor.set_left_arm_control_mode(ControlMode.JOINT_IMPEDANCE) + if args.right: + print("right") + victor.set_right_arm_control_mode(ControlMode.JOINT_IMPEDANCE)