MAVSDK: Consecutive param sets trigger exception

@dakejahl reports:

This causes an exception

_param_interface->set_param_int(param_name, val);
_param_interface->set_param_int(param_name, val);

terminate called after throwing an instance of 'std::future_error'
what():  std::future_error: Promise already satisfied

Is there a reason why setting parameters back to back like this would be a problem? If I add a sleep in between it works

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (6 by maintainers)

Most upvoted comments

TBH I hate using std::make_shared and all that other excessive syntax.

std::shared_ptr for plugins is no longer necessary, and we’re updating the examples: https://github.com/mavlink/MAVSDK/pull/1270/files#diff-76a888fbf298963b3e21d48a9d7efd522e32ac8e65446b29311addaf78602453R104-R106

all that other excessive syntax.

I would challenge that.

Plus references everywhere can be pretty inconvenient

It’s often inconvenience against safety, I’d say.