persist send of gains through c+ api

Questions about our C++ API
Post Reply
ased
Posts: 7
Joined: Mon Aug 16, 2021 4:38 am

persist send of gains through c+ api

Post by ased » Wed Oct 27, 2021 10:27 am

Hi,

I was going through the c++ hebi API here : https://files.hebi.us/docs/cpp/cpp-3.4. ... uator.html
and was wondering if it was possible to persist send (keep in the memory) desired gains through the API without using the scope.

Best,
Asma
User avatar
matt_tesch
HEBI Official
Posts: 27
Joined: Mon Mar 30, 2020 9:14 am
Location: Pittsburgh, USA

Re: persist send of gains through c+ api

Post by matt_tesch » Wed Oct 27, 2021 10:51 am

Asma,

This is supported in the underlying C API, but not the C++ one at the moment.

One big-picture thought here -- in our internal development, we have found that it can be dangerous to rely on the actuator always having the desired settings persisted when starting to control the program, in case other programs or users have accidentally changed the settings. This can significantly change the behavior of the robot in ways that are difficult to debug. So, in general, we encourage users not to rely on settings persisted on the actuators, and instead set these during program startup.

However, I understand there are definitely benefits to persisting the settings -- for example, if you take the above approach and send _and_ persist the settings during program startup, if can ensure that if the actuator is restarted during the running of the control application, the settings will not revert.

On to the technical solution!

This is a very quick addition to the C++ API. I'll try to get this implemented today, so we can get a nightly build up today, and then release a new version of the C++ API on Friday with a couple other changes.

Thanks for the feedback!

Best,
Matt
ased
Posts: 7
Joined: Mon Aug 16, 2021 4:38 am

Re: persist send of gains through c+ api

Post by ased » Thu Oct 28, 2021 3:43 am

Hi Matt, thank for your reply

I understand and agree with your points, that helps a lot to have an expert opinion on this.

Looking forward to testing the new API

Best,
Asma
User avatar
matt_tesch
HEBI Official
Posts: 27
Joined: Mon Mar 30, 2020 9:14 am
Location: Pittsburgh, USA

Re: persist send of gains through c+ api

Post by matt_tesch » Fri Oct 29, 2021 5:54 pm

Asma,

As I went to implement this, I realized I completed missed it earlier -- this is actually in the API already! This is in the Command::Settings message:
https://files.hebi.us/docs/cpp/cpp-3.4. ... tings.html

There is an example in the C++ examples repo demonstrating this for changing the name of a module and the saving the settings, but as the "persist settings" command applies to all active settings, this is the same for gains:
https://github.com/HebiRobotics/hebi-cp ... xample.cpp

Hope this helps, and let me know if you come across anything else to include in an upcoming release.

Best,
Matt
Post Reply