Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Trying your python on a real robot #3

Open
elpimous opened this issue Jan 3, 2022 · 4 comments
Open

Trying your python on a real robot #3

elpimous opened this issue Jan 3, 2022 · 4 comments

Comments

@elpimous
Copy link

elpimous commented Jan 3, 2022

Hello Emiliano,
This package works like a charm.
Now, I'd like to test it on my real robot, running with BLDC motors.
I'd like to use your python file, to command my motors. (before doing same in c++)
Could you tell me what function sends to motor boards, and what receive motor values?
Thanks

@eborghi10
Copy link
Owner

Hey @elpimous, in my opinion, the easiest way to test this in a real robot would be to use the MIT Controller library (written in C++) which uses the LCM library to interface with the hardware drivers.

The Python components of this code are the simulations which, if you want to try in the real robot, are not needed.

Maybe another approach if you prefer Python, is to replace the walking_simulation.py script but some code that makes use of the libquadruped_ctrl.so shared library like in here but sadly it's not in my plan to do it because this repo is only focused on simulating the MIT Cheetah.

@elpimous
Copy link
Author

elpimous commented Jan 7, 2022

Hey, @eborghi10 , I agree with you, but, to anderstand c++ code, i need to test python file, to see where c++ fonctions acts, and why (i'm a nearly newbie, and an autodidact coder)
Could you just confirm me that in your python file :
L239 : imu_data, leg_data, base_pos, contact_points = self.__get_data_from_sim() this fonction receives imu, and motors specs..
And for my real robot, I could send here, in each variable, the real params (10 imu_data params, and joint_positions, joint_velocities, and joint_names of all 12 real motors).

and
L249 : tau = self.cpp_gait_ctrller.torque_calculator(self.__convert_type( imu_data), self.__convert_type(leg_data["state"])) the tau variable contents the 12 joints torque params to send to real motors controllers.

Don't see in the py file, where to pick position and velocity to send to real motors, too ?!!

Thanks a lot, Emiliano.

Vincent

@elpimous
Copy link
Author

@eborghi10 small UP?!

@eborghi10
Copy link
Owner

L239 : imu_data, leg_data, base_pos, contact_points = self.__get_data_from_sim() this function receives imu, and motors specs.. And for my real robot, I could send here, in each variable, the real params (10 imu_data params, and joint_positions, joint_velocities, and joint_names of all 12 real motors).

Yes, that's correct. This part "reads" from sensors drivers.

and L249 : tau = self.cpp_gait_ctrller.torque_calculator(self.__convert_type( imu_data), self.__convert_type(leg_data["state"])) the tau variable contents the 12 joints torque params to send to real motors controllers.

Don't see in the py file, where to pick position and velocity to send to real motors, too ?!!

In this case, the motors are controlled by torque and not velocity or position. This is because the system that is controlled takes its dynamics into account.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants