Skip to content
Snippets Groups Projects
Commit bc90403c authored by Pierre-Alexandre Leziart's avatar Pierre-Alexandre Leziart
Browse files

Remove -i argument to launch the script, read the yaml data instead for the name of the interface

parent 8d09e59c
No related branches found
No related tags found
No related merge requests found
...@@ -83,17 +83,19 @@ def clone_movements(name_interface_clone, q_init, cloneP, cloneD, cloneQdes, clo ...@@ -83,17 +83,19 @@ def clone_movements(name_interface_clone, q_init, cloneP, cloneD, cloneQdes, clo
return 0 return 0
def control_loop(name_interface, name_interface_clone=None, des_vel_analysis=None): def control_loop(name_interface_clone=None, des_vel_analysis=None):
"""Main function that calibrates the robot, get it into a default waiting position then launch """Main function that calibrates the robot, get it into a default waiting position then launch
the main control loop once the user has pressed the Enter key the main control loop once the user has pressed the Enter key
Args: Args:
name_interface (string): name of the interface that is used to communicate with the robot
name_interface_clone (string): name of the interface that will mimic the movements of the first name_interface_clone (string): name of the interface that will mimic the movements of the first
""" """
# Check .yaml file for parameters of the controller # Check .yaml file for parameters of the controller
# Name of the interface that is used to communicate with the robot
name_interface = params.interface
# Enable or disable PyBullet GUI # Enable or disable PyBullet GUI
if not params.SIMULATION: if not params.SIMULATION:
params.enable_pyb_GUI = False params.enable_pyb_GUI = False
...@@ -350,17 +352,13 @@ def main(): ...@@ -350,17 +352,13 @@ def main():
""" """
parser = argparse.ArgumentParser(description='Playback trajectory to show the extent of solo12 workspace.') parser = argparse.ArgumentParser(description='Playback trajectory to show the extent of solo12 workspace.')
parser.add_argument('-i',
'--interface',
required=True,
help='Name of the interface (use ifconfig in a terminal), for instance "enp1s0"')
parser.add_argument('-c', parser.add_argument('-c',
'--clone', '--clone',
required=False, required=False,
help='Name of the clone interface that will reproduce the movement of the first one \ help='Name of the clone interface that will reproduce the movement of the first one \
(use ifconfig in a terminal), for instance "enp1s0"') (use ifconfig in a terminal), for instance "enp1s0"')
f, v = control_loop(parser.parse_args().interface, parser.parse_args().clone) # , np.array([1.5, 0.0, 0.0, 0.0, 0.0, 0.0])) f, v = control_loop(parser.parse_args().clone) # , np.array([1.5, 0.0, 0.0, 0.0, 0.0, 0.0]))
print(f, v) print(f, v)
quit() quit()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment