Open ww-dut opened 3 weeks ago
Yes, each variable in parameter p
receive external real-time updated data and be added to subsequent iterative calculations.
In my original implementation, it was like this:
p = ca.vertcat(
state_now, # current state
mpc.state_target, # target state
arg_p_arm
)
In the mpc, p needs to be predefined with a length, like this:
self.P = ca.SX.sym('P', 2*self.n_states + 7 * (self.N + 1))
Only then can the reference values of the corresponding dimension be properly passed in. You may need to check whether you have correctly expanded the content of the p vector and updated it correctly throughout the program flow (such as building the cost).
Thank you for your reply. I have expanded self.P to subscribe to information sent by another node, but I feel that these information don't have any real application in the iterative process.Finally, I would like to ask if you have ever used soft or hard constraints to complete a specific task in the past. I would like to specify constraints through iterative information to complete the corresponding task.
Indeed, I have experimented with a variety of constraints, both soft and hard. I believe that the efficacy of the reference can be readily assessed by incorporating essential diagnostic print statements.
hello,the code i have seen many times,but there exists some questions.If you can help me solve this problem,i'll thanks you a lot. The problem is discribed below. Will each variable in parameter p receive external real-time updated data and be added to subsequent iterative calculations? I receive external data in real time to update p, but the external variables do not seem to change during the actual iteration.
p = ca.vertcat( state_now, # current state mpc.state_target, # target state arg_p_arm, car_desirestate, make_joint_dis, make_car_dis )