leggedrobotics / ocs2

Optimal Control for Switched Systems
https://leggedrobotics.github.io/ocs2
BSD 3-Clause "New" or "Revised" License
874 stars 225 forks source link

Run my own robot occur a problem #60

Open Zcyyy opened 1 year ago

Zcyyy commented 1 year ago

Hi, When I configured my robot using ocs2_legged_robot as an example, the following error occurred: image How should I define my input to ensure that the MPC runs successfully?

FaresKchaou commented 1 year ago

Hey! I am having the same problem! have you found a solution for this problem ?

Zcyyy commented 1 year ago

Hey! I am having the same problem! have you found a solution for this problem ?

Yes, the problem was resolved after I modified the config file. Please make sure that the degrees of freedom of your robot match those specified in the config file. Additionally, ensure that the names of the robot's end effectors and joints are the same. You can also modify the weights of the Q and R matrices. These are all factors that can potentially affect the calculations. Of course, there may be other factors that I haven't mentioned. @FaresKchaou

FaresKchaou commented 1 year ago

thx @Zcyyy that helped me a lot! have you test it it on a real Robot ? If yes, how have you done it ? you considered the MRT as your real Robot ? or you use the MRT to send the velocity commands to your ROBOT ? thx

Zcyyy commented 1 year ago

thx @Zcyyy that helped me a lot! have you test it it on a real Robot ? If yes, how have you done it ? you considered the MRT as your real Robot ? or you use the MRT to send the velocity commands to your ROBOT ? thx

I'm glad the previous answer was helpful to you. What you mentioned is one of the areas I have been exploring recently. If you want to apply it to your own real robot, you may need to write some ros control files. The control content sent depends on your control mode and motor model. ocs2 provides PD control and PD+FF control methods.

FaresKchaou commented 1 year ago

thank you for your quick reply! i want to test ocs2 with a real franka panda robot before testing it on a mobile manipulator. i will be thankful for some input or some help! what i still didn't exactly get is: if the real robot is replacing the MRT so that i need to run the panda controller and just apply the mpc_policy (joint velocities) from the mpc node and then send the real states of the joints via mpc_observation topic (i think this is wrong because the MRT node is getting also the mpc_target topic)? i would be very thankful if you provide me some small tips!

Zcyyy commented 1 year ago

thank you for your quick reply! i want to test ocs2 with a real franka panda robot before testing it on a mobile manipulator. i will be thankful for some input or some help! what i still didn't exactly get is: if the real robot is replacing the MRT so that i need to run the panda controller and just apply the mpc_policy (joint velocities) from the mpc node and then send the real states of the joints via mpc_observation topic (i think this is wrong because the MRT node is getting also the mpc_target topic)? i would be very thankful if you provide me some small tips!

According to my understanding of ocs2, you cannot replace MRT. MRT is an important part to get the robot state observation. You should focus on the OC Rollout part.

ppap36 commented 10 months ago

I am sorry to raise a question that has no bussienss with your problem. SORRY but have you ever met the problem mentioned in issue #87 sorry to bother you