VOXL ESC FPV queries
-
@Alex-Kushleyev I am using flight core v2 as external FC. Due to which i am getting error message when i run the command
px4-listener
.Can you help me out here. how to get the data when we use external FC.
-
@Jetson-Nano Try out
voxl-inspect-mavlink
, if you hit tab a couple times it should populate with the various pipes you can read from -
thanks @tom for reverting back. I had already tried it and I was not able to see any RC channel data. listener function was not working.
The issue is I am not able to see the RC channel changes. Can you help me out how am I supposed to get the RC changes. -
Hi @Jetson-Nano, sorry i originally did not realize that you are running PX4 outside VOXL2. In this case
px4-listener
approach will not work.However, in the case of PX4 running on flight core (v1 or v2), there is still communication between Flight Core and VOXL2.
voxl-mavlink-server
should be communicating with the Flight Core via UART and passing messages back and forth. Depending whether the forwarding of RC topic is enabled or not,voxl-mavlink-server
would receive those messages (if enabled) and in that case they would be accessible on VOXL2.@tom , can you please elaborate on how to double check if the RC message is set up to forward to
voxl-mavlink-server
from Flight Core (if not, how to enable it) and how to actually read that message?Thanks!
Alex
-
@Alex-Kushleyev @Jetson-Nano You'll want to make sure that in
/etc/modalai/voxl-mavlink-server.conf
thaten_external_uart_ap
is set totrue
Once you restart the service you should be able to run
voxl-inspect-mavlink mavlink_offboard
to view the generated messages from FC -
@tom @Alex-Kushleyev thanks guys. I will check it and get back to you with the result.
-
@Alex-Kushleyev @tom
Guys I checked what you guys mentioned.
Theen_external_uart_ap
is set to True, but when I run the commandvoxl-inspect-mavlink mavlink_offboard
, the terminal is showingwaiting for pipe to connect
and not showing anything else.Adding to the previous point there is no mavlink_offboard showing up.
-
@Jetson-Nano , is
voxl-mavlink-server
actually running? you can check usingvoxl-inspect-services
.Also, are you sure that your Flight Core V2 is connected to
/dev/ttyHS1
, which would be implied by usingautopilot_uart_bus: 1
. How exactly are you connecting it to VOXL2?Alex
-
@Alex-Kushleyev
yes thevoxl-mavlink-server
is running, I had checked it.I am following this documentation for FC connections.
-
@Jetson-Nano , can you please clarify which connector on VOXL2 is your Flight Core connected to (for uart communication) and whether you have any indication that the communication is established? Have you previously been able to connect to VOXL2 from QGC and access the Flight Core V2 while it has been connected to VOXL2?
Alex
-
@Alex-Kushleyev I currently use, VOXL2 USB 3.0 Expansion Adapter connected to VOXL2. From the UART7 port of the Expansion Adapter I have connected to 6-PIN Telemetry1 Port in Flight Core V2.
My connection is similar to this,
As you mentioned earlier, I'm establishing connection through port
/dev/ttyHS1
. When I run thecat
command to read the messages from this port, I get garbled data as below,.
I'm not exactly clear when you mean if I have tried connecting to VOXL2 from QGC and access the Flight Core V2. Few things I have tried is,
-
Connecting to FlightCore V2 by connecting to Wifi of VOXL2. I also have a Wifi setup on VOXL2, which also acts as my Telemetry line. From QGC I connect to this local network to access FC data and PX4 parameters on Flight Core V2.
-
I have tried and tested few mavlink message commads which communicate with PX4 directly for C2C.
-
-
@tom As per your response on shifting to
voxl-inspect-mavlink mavlink_offboard
, I see that even in mavlink server documentation from ModalAI that service pipeline is not listed. Is it that something that has to be explicitly be enabled somewhere?
Even as per the documentation, I dont see this service pipeline listed. -
@Jetson-Nano I could have the naming wrong. If you inspect
mavlink_onboard
what kind of data do you see? -
@tom This is the output I get,
-
@Jetson-Nano Since you don't have voxl-px4 running I think that data is likely coming from your external flight controller
-
@tom yes, the message is coming from external flight controller, Flight core v2. Now can you share how to double check if the RC message is set up to forward to voxl-mavlink-server from Flight Core (if not, how to enable it) and how to actually read that message?
-
@Jetson-Nano Probably should also look at the pipe for messages from the flight controller to the GCS (Labeled mavlink_to_gcs in the above diagram but you'll have to double check that name). Generally the flight controller is configured with two mavlink streams. One is the onboard stream that has high rate messages and is intended for local use (e.g. on VOXL or VOXL 2) and the other is more the default settings for communication with a GCS. You can configure what each of these streams contain in PX4. You can add streams, change stream rates, etc. all via PX4 configuration. Please refer to the PX4 documentation for details on how to do this.
-
Hi @Eric-Katzfey, I was thinking another approach, where we can use pymavlink to get the RC_channel data. Any inputs to the mentioned approach, is it feasible?
-
@Jetson-Nano Yes, that should work. You should be able to send heartbeats from a Python script using pymavlink and connect to the flight controller via voxl-mavlink-server. Then you should start receiving all the normal messages sent out by the flight controller to the GCS which should include the RC channels message.
-
Thank you @Eric-Katzfey ,for the confirmation with respect to the approach. Can you help me the code, maybe with providing a sample code.
I wrote a code to receive the data but the code was not connecting the Flight controller. I am providing the code here, Can you verify the code.
from pymavlink import mavutil import time import logging logging.basicConfig(level=logging.INFO) # Connection string for voxl-mavlink-server connection_string = 'udp:192.168.8.1:14558' # Function to send a heartbeat message def send_heartbeat(mavlink_connection): mavlink_connection.mav.heartbeat_send( mavutil.mavlink.MAV_TYPE_GCS, # Type: Ground Control Station mavutil.mavlink.MAV_AUTOPILOT_INVALID, # Autopilot: Not a specific autopilot 0, # Base mode 0, # Custom mode mavutil.mavlink.MAV_STATE_ACTIVE # State: Active ) logging.info("Heartbeat sent.") def main(): try: logging.info(f"Connecting to {connection_string}...") # Establish MAVLink connection mav = mavutil.mavlink_connection(connection_string) # Send an initial heartbeat to register as a GCS logging.info("Sending initial heartbeat...") send_heartbeat(mav) # Wait for heartbeat from the flight controller logging.info("Waiting for heartbeat from the flight controller...") mav.wait_heartbeat(timeout=10) logging.info(f"Heartbeat received! System_ID: {mav.target_system}, Component_ID: {mav.target_component}") # Request RC_CHANNELS data stream at 1 Hz mav.mav.request_data_stream_send( mav.target_system, mav.target_component, mavutil.mavlink.MAV_DATA_STREAM_RC_CHANNELS, 1, # Stream rate in Hz (1 Hz) 1 # Enable the stream ) # Periodically send heartbeats to keep the connection alive last_heartbeat_time = time.time() while True: # Send a heartbeat every 1 second current_time = time.time() if current_time - last_heartbeat_time > 1: send_heartbeat(mav) last_heartbeat_time = current_time # Listen for incoming messages msg = mav.recv_match(blocking=True) if msg: msg_type = msg.get_type() logging.info(f"Received message: {msg_type}") # If it's an RC_CHANNELS message, print the values if msg_type == 'RC_CHANNELS': logging.info(f"Channel 1: {msg.chan1_raw}") logging.info(f"Channel 2: {msg.chan2_raw}") logging.info(f"Channel 3: {msg.chan3_raw}") logging.info(f"Channel 4: {msg.chan4_raw}") except KeyboardInterrupt: logging.info("Exiting program.") except Exception as e: logging.error(f"An error occurred: {e}") if __name__ == "__main__": main()
The following is the output I got and it was stuck here and not moving forward.
INFO:root:Connecting to udp:192.168.8.1:14559... INFO:root:Sending initial heartbeat... INFO:root:Heartbeat sent. INFO:root:Waiting for heartbeat from the flight controller... INFO:root:Heartbeat received! System_ID: 0, Component_ID: 0