Closed lujieyang closed 2 years ago
neural_network_lyapunov/examples/pole/simulation/utils.py, line 51 at r1 (raw file):
I thought we won't add schunk to the iiwa, but physically weld the end effector to the wrist link?
Sure, I will delete this function.
neural_network_lyapunov/examples/pole/simulation/pole_balancing_sim.py, line 81 at r1 (raw file):
Why using the discrete LQR instead of the continuous LQR? I would think we can use the continuous LQR directly. When you compute the discrete-time A, B matrix, you assume explicit Euler integration, which isn't really how Drake does time integration, so I think this discrete-time A, B aren't correct.
I see. Changing to continuous LQR
neural_network_lyapunov/examples/pole/simulation/pole_balancing_sim.py, line 84 at r1 (raw file):
I don't see `pole_state_input_port` being used.
Deleted
neural_network_lyapunov/examples/pole/simulation/pole_balancing_sim.py, line 87 at r1 (raw file):
Why we need this iiwa_state port?
Port deleted
neural_network_lyapunov/examples/pole/simulation/utils.py, line 20 at r1 (raw file):
This is different from the `l7_ee_offset` defined in `iiwa_and_plate.yaml`. Could you explain why? If they do mean the same thing, then I would prefer to defining it only in `iiwa_and_plate.yaml`, and read the rigid transform from yaml file.
We are not using the schunk so I'm deleting the definition. I just cleaned up the code a bit to remove dependencies on the utils.py (this file has a lot of extra functionalities that we don't need)
neural_network_lyapunov/examples/pole/simulation/pole_balancing_sim.py, line 63 at r1 (raw file):
You can compute this Ac and Bc matrix pretty easily by instantiating a `Pole` system and call its `gradient` function.
I calculated Ac, Bc offline. Would you recommend do it here instead?
neural_network_lyapunov/examples/pole/simulation/pole_balancing_sim.py, line 204 at r4 (raw file):
Could you explain a bit why the simulation is continuous time here? The IIWA controller is a discrete time system.
When I try to use discrete time step for MultibodyPlant, Drake gives the error "MultibodyPlant's discrete update solver failed to converge at simulation time = 0.00035 with discrete update period = 1e-05. This usually means that the plant's discrete update period is too large to resolve the system's dynamics for the given simulation conditions. This is often the case during abrupt collisions or during complex and fast changing contact configurations. Another common cause is the use of high gains in the simulation of closed loop systems. These might cause numerical instabilities given our discrete solver uses an explicit treatment of actuation inputs. Possible solutions include: switch to a continuous model (discrete update period is zero)."
The collision might be due to the initial impact of the pole with the plate.
neural_network_lyapunov/examples/pole/simulation/pole_balancing_sim.py, line 141 at r4 (raw file):
Could you document that `Q` stands for plate frame? And just curious, why this frame is abbreviated as `Q`?
Done.
I was borrowing code from the IK tutorial for the manipulation class.
neural_network_lyapunov/examples/pole/simulation/pole_balancing_sim.py, line 292 at r4 (raw file):
Unused?
Currently used in building the MBP for iiwa controller (not implemented)
neural_network_lyapunov/examples/pole/simulation/pole_balancing_sim.py, line 197 at r4 (raw file):
BTW, I don't think we have explained what `C` means here? Maybe document it that `C` is the point on the end effector where the pole makes contact on the end-effector, and `f_C_W` is the force applied from the pole to the end-effector at point C, and the force is measured in the world frame `W`. The reason to add this documentation is to make it clear where the force is applied, and who applies that force (since there is an equal and opposite force from the end-effector to the pole at the same point).
I'm removing f_C_W as a whole because we will later add the iiwa controller.
neural_network_lyapunov/examples/pole/simulation/pole_balancing_sim.py, line 197 at r4 (raw file):
Could you document what f_C_W is?
Done.
This change is