Add a new variable to the configuration. name - Complete name of the variable in the form group.name fetch_as - String representation of the type the variable should be fetched as (i.e uint8_t, float, FP16, etc) If no fetch_as type is supplied, then the s
(self, name, fetch_as=None)
| 166 | self.name = name |
| 167 | |
| 168 | def add_variable(self, name, fetch_as=None): |
| 169 | """Add a new variable to the configuration. |
| 170 | |
| 171 | name - Complete name of the variable in the form group.name |
| 172 | fetch_as - String representation of the type the variable should be |
| 173 | fetched as (i.e uint8_t, float, FP16, etc) |
| 174 | |
| 175 | If no fetch_as type is supplied, then the stored as type will be used |
| 176 | (i.e the type of the fetched variable is the same as it's stored in the |
| 177 | Crazyflie).""" |
| 178 | if fetch_as: |
| 179 | self.variables.append(LogVariable(name, fetch_as)) |
| 180 | else: |
| 181 | # We cannot determine the default type until we have connected. So |
| 182 | # save the name and we will add these once we are connected. |
| 183 | self.default_fetch_as.append(name) |
| 184 | |
| 185 | def add_memory(self, name, fetch_as, stored_as, address): |
| 186 | """Add a raw memory position to log. |