Hi,
I want to write a generic C++ class which utilizes MavSdk C++ API. The user will not deal with details of MavSdk C++ API and just call generic methods. I followed the guidelines and examined the example code but I got stuck at some point.
I have an “Initialize()” method which makes the connection with the PX4, then discovers system and return system object". I can keep the “System” object as a private class attribute, so I can use the same system object anywhere within the class. I want to do the same with “telemetry”, “action” and “offboard” plugins but could not manage it.
I want to keep private variables for each of these plugins. Declare them at header file and initialize them in the “Initialize()” method just after initializing “system” object.
For example:
- I define “std::shared_ptr systemObj” in class header.
- I define “mavsdk::Offboard myOffboardObj” in class header.
- Later, in Initilize() method, after filling the “systemObj” as following in the class implementation.
this->system = this->mavsdkObj.systems().at(0); - I can create a plugin as “Offboard tempOffboard = Offboard{this->system};”
- But i can not fill “myOffboardObj” the same way as:
myOffboardObj = Offboard{this->system};
The compiler says "Overload resolution selected deleted operator ‘=’ "
Can anyone help me about this issue?
Thanks in advance.