Closed nicolaerosia closed 6 years ago
This would fix my problem but I must admit I only looked for a couple of minutes
diff --git a/include/tansa/data.h b/include/tansa/data.h
index 07f1c1e..acebc2c 100644
--- a/include/tansa/data.h
+++ b/include/tansa/data.h
@@ -35,7 +35,7 @@ public:
return DataObject(data[key]);
}
-
+ const json& asJson() const { return data; }
template<int N, int M>
diff --git a/src/simulate/firmware.cpp b/src/simulate/firmware.cpp
index 142afcf..2d1649d 100644
--- a/src/simulate/firmware.cpp
+++ b/src/simulate/firmware.cpp
@@ -12,8 +12,7 @@ Firmware::Firmware(const DataObject &desc, MultirotorModel::Ptr model) {
currentActuatorOutputs.resize(4, 0);
this->id = desc["id"];
- json d = desc;
- this->rcScript = d["rc"];
+ this->rcScript = desc.asJson()["rc"].get<string>();
process = 0;
That looks reasonable. Changes on master now. Seems to be working, although I don't have 7.1.1 handy. Please close this issue if it is working on your machine now.
Hello,
Could you help me fixing this one
I have updated the json.hpp to latest found here https://github.com/nlohmann/json since I couldn't compile because of a "bug" there.
Thanks, Nicolae