-
Notifications
You must be signed in to change notification settings - Fork 112
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 clear the cache #122
Comments
hi @simeoncapy, what is your control scenario? |
hello @penglongxiang thanks for your answer! I will look at the code you shared to check if it's suitable (especially for safety regarding speed and acc), otherwise, I can use |
I'm going back @penglongxiang Then I tried to switch the state, but it's not working, the robot is not moving, so maybe it is too fast. (sometimes I got the error 9) Here is a piece of my code, called by the ROS callback. In this case
Just to be sure, |
I see, if you are not updating the command at servo rate (>50Hz), then there is another mode you can try. Which is the online planning mode (mode 7), in this mode, the API will still be set_position(). Difference is only the latest received command will be effective (previous command will be interrupted upon new command reception) and the robot will adjust to the latest target with controlled max velocity and acceleration. Please refer to this example. This may better suit your application.
|
Thanks for the answer. I used the mode 7, it's better and follows my command more, but it looks like it stills has a cache. For example, when I stop it continues to move. I did a test with a lower frequency (10 Hz). Moreover, what is the command Because sometimes, I send the command to a position, and the result is totally different:
|
In my code, I get several commands from my controller and then send them to the xArm with the
set_position
function. However, the commands seem to be added to a cache, making all the processes super slow (even continuing after the script stops).I couldn't find a function to discard all previous commands before sending a new one. Is there a way to do it?
For the problem with the robot moving after the script stops, I guess I can call the
reset
function in the destructor.The text was updated successfully, but these errors were encountered: