yaswanth1701 / Trajectory-Optimization

This repo contains trajectory-optimisation on some basic systems (ex: pendulum,cartpole ,quadrotors and manipulators). Will be implementing algorithms like finite horizon LQR, iLQR and Box DDP
17 stars 1 forks source link

The dof of the franka_panda #2

Closed ppap36 closed 2 months ago

ppap36 commented 2 months ago

Hey Bro! I am glad to know that you updated. Thank you so much!

For you franka_panda program, I have a problem.

Why the dof of the arm is set as 9? I think it should be 7 self.desired_joint_vel = np.zeros(9) (line 18 of the Franka.py)

yaswanth1701 commented 2 months ago

Hi, nice to hear from you. So, the logic behind 9 dof is that pybullet returns states for 9 joints, which are 7 revolute joints and 2 prismatic joints for the gripper. We don't want these prismatic joints to move, so the optimisation should simply return zero torques for these joints (as we are not doing grasping and just want to move the end effector from a point to another point). The reason behind this was I initially don't wanted to modify the code for iLQR everytime we have a new dynamical system and wanted stick to a particular style of code however, there better ways of doing this.

But afaik the code was not working as expected when I last tried which was 4-5 months ago. I haven't been actively working on this currently, due to other commitments and I don't think this the best way to control manipulators as they are fully actuated which I recently got to know. If you are willing to work on this please consider opening a pull request which fixes the current issue. Thanks for reaching out 😊!!

ppap36 commented 2 months ago

thanks a lot,Bro!!!!!!!

ppap36 commented 2 months ago

I am considering that whether I can transform your code into the ROS + RVIZ form, I hope I can make it

yaswanth1701 commented 2 months ago

I have a similar implemention, you can check this out https://github.com/yaswanth1701/MPC-for-Mobile-Robot

ppap36 commented 2 months ago

I saw you had Comment the code ` #self.initial_acc = self.get_joint_acceleration(mass_matrix,self.initial_torque,self.initial_torque)

initial_acc,self.initial_torque, mass_matrix = self.forward_dynamics(self.initial_joint_pos,self.initial_vel,self.initial_acc)`

And that code is related to the PINOCCHIO.

I wonder why you did not use the PINOCCHIO to calculate the dynamic of the PANDA, but you used the PYBULLET to calculate the dynamic of the PANDA.

yaswanth1701 commented 2 months ago

I was just trying it out.

ppap36 commented 2 months ago

OK thanks a lot