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 change the loop frequency of legged_controller #49

Open
jn6201 opened this issue Sep 6, 2023 · 1 comment
Open

How to change the loop frequency of legged_controller #49

jn6201 opened this issue Sep 6, 2023 · 1 comment

Comments

@jn6201
Copy link

jn6201 commented Sep 6, 2023

it seems like the update frequency is fixed to 1000 Hz, since the ros topic "_mpc_observation" is always published at 1000 Hz in the update() function of LeggedController. I tried to reset the publish rate of the customized ros_controller to 500 HZ by adding "publish_rate:500" in the controllers.yaml which can work on joint_state_controller. But cant really change the rate of legged_controller. May anyone tell me what's wrong, or how to confirm the main control loop frequency?

@jn6201
Copy link
Author

jn6201 commented Sep 20, 2023

I figured out the rate setting problem, maybe we can set the whole control loop's period by adding in the gazebo plugin label in robot's urdf file
<gazebo> <plugin filename="libgazebo_ros_control.so" name="gazebo_ros_control"> <robotNamespace>/</robotNamespace> <robotParam>legged_robot_description</robotParam> <robotSimType>legged_gazebo/LeggedHWSim</robotSimType> <controlPeriod>0.001</controlPeriod> </plugin> </gazebo>
When I set it to 0.002, the publish rate turned into 500 Hz, but facing a new problem: the controller seems to be unstable, the robot couldn't hold it's position. Is it because the frequency is not enough or somewhere in the code set the frequency must be 1000 Hz?

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

1 participant