The benefit of this is when the user creates functions that they want to evaluate later (this is assuming you don't pass symbolic variables). For example, when I want the wrench at the end-effector from the joint, I want a function to evaluate the Jacobian. Since I am not defining an optimization problem, I will be doing the computation in Numpy (faster than casadi DM).
Difference
Before
robot = optas.RobotModel(...)
pos = robot.get_global_link_position_function(ee_link)
p = pos(q).toarray().flatten() # pos(q) outputs a casadi.DM array
After
robot = optas.RobotModel(...)
pos = robot.get_global_link_position_function(ee_link, numpy_output=True)
p = pos(q) # since numpy_output=True is specified, the output is automatically converted to a numpy array
When numpy_output=True is specified, if you pass a symbolic variable in then the method will fail since you are telling optas that you are expecting not to be passing symbolic variables.
Motivation
The benefit of this is when the user creates functions that they want to evaluate later (this is assuming you don't pass symbolic variables). For example, when I want the wrench at the end-effector from the joint, I want a function to evaluate the Jacobian. Since I am not defining an optimization problem, I will be doing the computation in Numpy (faster than casadi DM).
Difference
Before
After
When
numpy_output=True
is specified, if you pass a symbolic variable in then the method will fail since you are telling optas that you are expecting not to be passing symbolic variables.Todo before merge