Closed mstoelzle closed 2 years ago
Usually all the force classes are inherited from NoForces class. We can define our own Force/Torque class to provide the actuation. In this class they coded for varying beta spline if I make a separate class then the working & code would be similar to this. And for inheritance we can use the classes which are availble in the elastica package i.e., NoForces, GravityForces, EndpointForces, UniformTorques, UniformForces, MuscleTorques. And only NoForce is needed & useful for inheritance.
So, do you want me to make a custom class like this for passing it add_forcing() method & applying actuation with changing control points?
Please refer first to issue #16.
Let me put the priorities like this:
from elastica.x.external_forces import UniformTorques
class CustomUniformTorques(UniformTorques):
def __init__(self, torque, direction=np.array([0.0, 0.0, 0.0])):
super(CustomUniformTorques, self).__init__()
INSERT_YOUR_CUSTOM_CODE
def apply_torques(self, system, time: np.float64 = 0.0):
super(CustomUniformTorques, self).apply_torques(system, time)
INSERT_YOUR_CUSTOM_CODE
So, for now as we are changing the actuation model do I need to customise the varying beta spline class instead of using their module from Elastica-RL or will it be better to move on with creating the custom class for uniform torques where the applied torque keeps changing according to the controller
So, for now as we are changing the actuation model do I need to customise the varying beta spline class instead of using their module from Elastica-RL or will it be better to move on with creating the custom class for uniform torques where the applied torque keeps changing according to the controller
You can directly move on to the UniformTorques and the revised actuation model
Okay sure
Hi @mstoelzle , in the new actuation model, I've used the unmodified force class of Uniform torque. Kindly test it
Please try to avoid copying the elastica code and instead try to find another way for the implementation such as class inheritance etc
https://github.com/tud-cor-sr/ros2-elastica/blob/main/elastica_sim_control/elastica_sim_control/muscle_torques_with_bspline_numba.py https://github.com/tud-cor-sr/ros2-elastica/blob/main/elastica_sim_control/elastica_sim_control/muscle_torques_with_bspline_numpy.py