Skip to content
This repository has been archived by the owner on Aug 3, 2021. It is now read-only.

Roscpp Update Params #191

Closed
EceChaik opened this issue Oct 15, 2020 · 2 comments
Closed

Roscpp Update Params #191

EceChaik opened this issue Oct 15, 2020 · 2 comments

Comments

@EceChaik
Copy link

Hi guys,

not really an issue with the package, but I cannot find out how to properly call the UpdateParams service with roscpp, something like the equivalent of:

update_params = rospy.serviceProxy('update_params',UpdateParams)
and
update_params(["kalman/initialX", "kalman/initialY", "kalman/initialZ"])

@EceChaik
Copy link
Author

I made it work by using:

std::vector< std::string > vec;
vec.push_back("kalman/initialX");

and so on, and then

crazyflie_driver::UpdateParams upd_serv;
upd_serv.request.params = vec;
client.call(upd_serv);

it seems to work, but if anyone knows of a better way, do let me know

@whoenig
Copy link
Owner

whoenig commented Oct 16, 2020

Some other options would be to 1) directly push_back() on upd_serv.request.params, or 2) use a C++11-style initializer {"kalman/initialX", "kalman/initialY"} on upd_serv.request.params.

@whoenig whoenig closed this as completed Oct 16, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants