double_pendulum.experiments
Submodules
double_pendulum.experiments.experimental_utils
- double_pendulum.experiments.experimental_utils.rad2rev(angle_in_radians)
Convert radians to revolutions.
- Parameters:
- angle_in_radiansfloat
angle, unit=[rad]
- Returns:
- float
angle in revolutions
- double_pendulum.experiments.experimental_utils.rev2rad(angle_in_revolution)
Convert revolutions to radians.
- Parameters:
- angle_in_revolutionfloat
angle, unit=[rev]
- Returns:
- float
angle in radians
- double_pendulum.experiments.experimental_utils.save_data(save_dir, date, shoulder_meas_pos, shoulder_meas_vel, shoulder_meas_tau, elbow_meas_pos, elbow_meas_vel, elbow_meas_tau, meas_time)
save data to csv file. Deprecated. One should use double_pendulum.utils.save_trajectory instead.
- double_pendulum.experiments.experimental_utils.setZeroPosition(motor, initPos, initVel, initTau)
Set the zero position for a tmotor.
- Parameters:
- motormotor_driver.canmotorlib.CanMotorController
motor whose position will be initialized
- initPosfloat
initial motor position from sensor readings
- initPosfloat
initial motor velocity from sensor readings
- initPosfloat
initial motor torque from sensor readings
double_pendulum.experiments.hardware_control_loop_mjbots
double_pendulum.experiments.hardware_control_loop_tmotors
- double_pendulum.experiments.hardware_control_loop_tmotors.run_experiment(controller, dt=0.01, t_final=10.0, can_port='can0', motor_ids=[1, 2], motor_type='AK80_6_V1p1', tau_limit=[6.0, 6.0], save_dir='.', record_video=True)
run_experiment. Hardware control loop for tmotor system.
- Parameters:
- controllercontroller object
controller which gives the control signal
- dtfloat
timestep of the control, unit=[s] (Default value=0.01)
- t_finalfloat
duration of the experiment (Default value=10.)
- can_portstring
the can port which is used to control the motors (Default value=”can0”)
- motor_idslist
shape=(2,), dtype=int ids of the 2 motors (Default value=[8, 9])
- motor_typestring
the motor type being used (Default value=”AK80_6_V1p1”)
- tau_limitarray_like, optional
shape=(2,), dtype=float, torque limit of the motors [tl1, tl2], units=[Nm, Nm] (Default value=[4., 4.])
- save_dirstring of path object
directory where log data will be stored (Default value=”.”)
double_pendulum.experiments.performance_profiler
- double_pendulum.experiments.performance_profiler.motor_send_n_commands(numTimes=1000)
- double_pendulum.experiments.performance_profiler.motor_send_n_commands2(motor_ids=[8, 9], can_port='can0', numTimes=1000)
- double_pendulum.experiments.performance_profiler.motor_speed_test(motor_ids=[8, 9], can_port='can0', n=1000)
- double_pendulum.experiments.performance_profiler.motor_speed_test2(motor_ids=[8, 9], can_port='can0', n=1000)
- double_pendulum.experiments.performance_profiler.profiler(data_dict, start, end, meas_dt)
validate avg dt of the control loop with (start time - end time) / numSteps