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

How to control actuators with low level control in python #207

Open
jes-bro opened this issue Oct 16, 2024 · 2 comments
Open

How to control actuators with low level control in python #207

jes-bro opened this issue Oct 16, 2024 · 2 comments

Comments

@jes-bro
Copy link

jes-bro commented Oct 16, 2024

Is there an example script that demonstrates how to use ActuatorCyclic/how to control actuators at the lower level that aren't the gripper? We're trying to independently control actuators at the 1kHz rate. Thanks!

@jes-bro
Copy link
Author

jes-bro commented Oct 16, 2024

New question: how do you do low level position control in python?

@martinleroux
Copy link
Collaborator

Hi @jes-bro ,

It seems the low-level position control example is missing in Python.
The logic is the same as in C++, so you can have a look at this example.

Alternatively, you can refer to the syntax in the torque control example and simply not switch the control mode to torque at line 195.

In short, the easiest way to do low-level position control is to create a BaseCyclic client object with a UDP transport and then call baseCyclicClient.Refresh(command) at 1 kHz.

It is possible to control the individual actuators through the ActuatorCyclic client by putting the robot in LOW_LEVEL_BYPASS mode instead of LOW_LEVEL_SERVOING, but I have yet to hear of any reason to do it since the result is just doing the above with extra steps (i.e. calling Refresh once per actuator instead of a single time for all of them every frame). As a matter of fact, I expect low-level via ActuatorCyclic not to be possible in Python not because the feature is not supported, but because it is unlikely that your system can hold a stable 1kHz control loop with 6-7 different devices at the same time in an interpreted language.

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