I am trying to set up a test setup primarily to try and learn how Mavlink works.
I have some ideas I want to try
I have a
rPi3
rPi camera
pixhawk
no other sensors connected
I have copied the companion s/w on to the rPi and ran setup up.
It doesn’t start automatically on reboot. What files are scripts do I need to add to make this work. In fact I don’t know what scripts to start to run t either
Also can I change the IP address on gGroundControl from 192.168.2.1 is the same as my router and it is a pain fiddling with my network each time
For now, it’s not possible to install companion manually.
For that, you’ll need to make .companion.rc to start with the system, this will call all necessary companion components.
You can use set_default_client_ip.sh (E.g: ./set_default_client_ip.sh 192.168.2.2) to set the raspberry IP address for ethernet connection. If you are running a Linux in your surface computer, you can use nmap to find the ip while scanning port 22 (E.g: nmap 192.168.0.1-255 -p 22).
I re flashed my rPi and it is working how I intended.
Just one further point.
What port is MavLink streaming its messages ?
I would like to connect to this data stream for further processing and logging of the data. I am writing a photogrammetry application. I am also looking at seeing if I can get a dead reackoning function working using the thruster values and the IMU.
You can take a further look in ardusub software components webpage to understand how the companion system works.
MAProxy sends the protocol using UDP in 14550.
You need to specify the server address and port to the socket object, looking in the socket documentation you can see the bind function. Bind the socket to address. The socket must not already be bound. (The format of address depends on the address family — see above.)
Yes, 14550 is a bidirectional port, mavproxy can read from it.
Now, about the GPS, you can take a look in gps-position (Sending GPS position to ROV) from ArduSub gitbook. MAVProxy will receive position data from 25100, you check the example to test it.
Also, it’s possible to send possition via pymavlink, take a look in pymavlink (Send GPS position) examples of ArduSub gitbook.
GPS_RAW_INT is the wrong message for this; this message is only for autopilot feedback/status updates on the current position. The one to use is GPS_INPUT.
I have tried sending ‘GPS_INPUT’ on port 14550 but reading message GLOBAL_POSITION_INT which I would assume is the processed EKF solution shows nothing.
I also tried sending on port 25100 but same result.
Is the socket 25100 on the ROV running as server or a client ?
You can see all of the code here, this same project is in the home directory on the pi.
More specifically, you can see the code for the serverhere, and modify it too. Maybe add some print statements to see what’s going on.
On a pi console, you can enter screen -r nmearx to get back to the process that is started at boot. From there you can exit it, modify the script and just run it again.