How to get zoom level via DJIBridge
CompletedConsider the code:
def on_connect(client, userdata, flags, rc):
print("Connected with result code " + str(rc))
# Subscribing in on_connect() means that if we lose the connection and
# reconnect then subscriptions will be renewed.
client.subscribe("sys/#")
client.subscribe("thing/#")
def on_message(client: mqtt.Client, userdata, msg: mqtt.MQTTMessage):
if msg.topic.endswith("osd") and msg.topic.startswith("thing"):
pprint.pprint(message)
This presents the following output:
{'activation_time': 1621404238,
'attitude_head': -103.9,
'attitude_pitch': -0.4,
'attitude_roll': 1.4000000000000001,
'battery': {'batteries': [{'capacity_percent': 75,
'firmware_version': '01.02.05.44',
'high_voltage_storage_days': 0,
'index': 0,
'loop_times': 184,
'sn': '1Z6PHCNDA029WE',
'sub_type': 0,
'temperature': 35,
'type': 0,
'voltage': 48288},
{'capacity_percent': 73,
'firmware_version': '01.02.05.44',
'high_voltage_storage_days': 0,
'index': 1,
'loop_times': 201,
'sn': '1Z6PJ4CDA000A5',
'sub_type': 0,
'temperature': 33.2,
'type': 0,
'voltage': 48300}],
'capacity_percent': 74,
'landing_power': 5,
'remain_flight_time': 0,
'return_home_power': 0},
'distance_limit_status': {'distance_limit': 0,
'is_near_distance_limit': 0,
'state': 0},
'elevation': 0,
'exit_wayline_when_rc_lost': 0,
'firmware_version': '60.01.0003',
'gear': 1,
'height': 16.300565719604492,
'height_limit': 0,
'home_distance': 0,
'horizontal_speed': 0,
'is_near_height_limit': 0,
'latitude': 0,
'longitude': 0,
'maintain_status': {'maintain_status_array': [{'last_maintain_flight_sorties': 0,
'last_maintain_flight_time': 0,
'last_maintain_time': 0,
'last_maintain_type': 1,
'state': 0},
{'last_maintain_flight_sorties': 0,
'last_maintain_flight_time': 0,
'last_maintain_time': 0,
'last_maintain_type': 2,
'state': 0},
{'last_maintain_flight_sorties': 0,
'last_maintain_flight_time': 0,
'last_maintain_time': 0,
'last_maintain_type': 3,
'state': 0}]},
'mode_code': 0,
'night_lights_state': 0,
'obstacle_avoidance': {'downside': 0, 'horizon': 0, 'upside': 0},
'position_state': {'gps_number': 0,
'is_fixed': 0,
'quality': 0,
'rtk_number': 0},
'rc_lost_action': 2,
'rth_altitude': 100,
'storage': {'total': 0, 'used': 0},
'total_flight_distance': 216702.8021057332,
'total_flight_sorties': 0,
'total_flight_time': 0,
'track_id': '',
'vertical_speed': 0,
'wind_direction': 0,
'wind_speed': 0}
I need to find the zoom_level of the camera, gimbal, video and the mode switch on the Remote Controller . Drone is M30T, and M300
My question:
Which TOPIC do I need to subscribe to to get:
- camera zoom level
- mode switch
- gimbal attitude
- Video
-
Dear developers, Hello, thank you for contacting DJI Innovation. Live camera switching: Topic: thing/product/{gateway_sn}/services. Set up the live broadcast lens: Topic: thing/product/{gateway_sn}/services I hope our solution can help you, thank you for your email, wish you a happy life! Best Regards, Dji innovation SDK technical support
Please sign in to leave a comment.
Comments
1 comment