MQTT_MSG = {
"waypointMission":
{
# "plantId": "OLD PLAN",
"targetWaypoints":
[
{
"latitude": 14.237372,
"longitude": 77.457814,
"threatLevel": 1,
"timestamp": "",
"waypointExecuted": 0,
"waypointActions":
[
{
"action": "pitch",
"actionParam": -30
},
{
"action": "stay",
"actionParam": 3000
}
]
}
]}
print(MQTT_MSG['waypointMission']['targetWaypoints']['latitude'])
I want to change the value of the latitude and longitude of the dictionary.
It is throwing this error message:
TypeError: list indices must be integers or slices, not str
For this print(MQTT_MSG['waypointMission']['targetWaypoints'][0])
It prints a full dictionary inside the targetWaypoints.
I want to print latitude value.
Thanks in advance.