I am working with Inverted double pendulum in ROS2 Gazebo. I have written a controller which subscribes to /dynamic_joint_states and publishes to /effort_controller/commands of effort controller of ROS2 control to stabilize the links in vertical position.
My controller doesn't seems to be working.
Problem While trying to diagnose the issue, I realize when I echo the effort from /dynamic_joint_states and commanded effort from /effort_controller/commands, I see a lag between the two values.
Example When I command the effort to be 10 for all time, for first 1-2 seconds effort from /dynamic_joint_interface reads 0 then it goes to 10.
I am suspecting this lag to be causing my controller to fail. Even if this is not the issue can someone explain why there's a lag and is there a method to reduce that lag.