snap_cam icon indicating copy to clipboard operation
snap_cam copied to clipboard

run optical flow on startup

Open ChristophTobler opened this issue 7 years ago • 10 comments

I can start px4 on startup with upstart and this file in /etc/init/px4.conf.

start on (started q6 and net-device-up IFACE!=wlan0)
stop on stopping q6 or runlevel [016]

console log

script
  cd /home/linaro
  ./px4 mainapp.config
end script

However, when I add another script for the optical flow, the wifi does not work reliably and I lose connection after ~5s.

start on (started q6 and net-device-up IFACE!=wlan0)
stop on stopping q6 or runlevel [016]

console log

script
  cd /home/linaro/src/snap_cam/build
  ./optical_flow -f 90 -a
end script

I have also tried other things like

start on started q6 and started network-interface and started networking

@rkintada any ideas?

ChristophTobler avatar Jul 11 '17 14:07 ChristophTobler

I am using the latest linux build from intrinsyc (3.1.3.1). Seems to me like there is some issue with wifi and the camera.

ChristophTobler avatar Jul 11 '17 14:07 ChristophTobler

@rkintada any ideas?

ChristophTobler avatar Jul 18 '17 14:07 ChristophTobler

@ChristophTobler sorry for the delay. I am not sure of this. I will check with the team here and get back to you.

Thanks Rama

rkintada avatar Jul 18 '17 18:07 rkintada

@ChristophTobler I am also investigating this with Rama.

When you say that your WiFi link goes down after 5 seconds, do you know if the board has restarted at this time? If you maintain an adb connection while connected via WiFi you can tell if/when the board reboots.

Is it possible to collect minidm logs? This might provide a clue about the state of the system, especially if it is not rebooting.

Could you also try creating a pre-start script with a sleep period in the .conf file? I was thinking that we could experiment with delaying the optical flow startup to see if this makes a difference.

Jim W.

jywilson avatar Jul 18 '17 20:07 jywilson

@rkintada @jywilson Thanks guys!

The board does not seem to restart as I maintain the adb connection. The mini-dm output is

Running mini-dm version: 3.0
Device found with Product ID 0x9025. Continuing...
mini-dm is waiting for a DMSS connection...
DMSS is connected. Running mini-dm...
[08500/00]  01:18.793  HAP:52:TEST px4muorb_topic_advertised of [telemetry_status] on remote side...  0167  px4muorb.cpp
[08500/02]  01:20.260  HAP:36:Preflight checks always pass on Snapdragon.  0581  PreflightCheck.cpp
[08500/02]  01:48.495  HAP:36:Preflight checks always pass on Snapdragon.  0581  PreflightCheck.cpp

The weird thing seems to be that once I loose the wifi connection, I can rejoin the wifi and I get another ~5s (in QGC). I'll try the sleep at startup once more.

ChristophTobler avatar Jul 19 '17 08:07 ChristophTobler

I managed to get a bigger mini-dm output http://pasted.co/dab97694

ChristophTobler avatar Jul 19 '17 08:07 ChristophTobler

Same behavior when I put a 5s sleep before I run ./optical_flow -f 90 -a. Here's the dmesg output if that's of any help.

ChristophTobler avatar Jul 19 '17 08:07 ChristophTobler

@rkintada @jywilson any updates on this?

ChristophTobler avatar Aug 14 '17 08:08 ChristophTobler

Christoph,

I spoke with one of our platform engineers and he indicated that the video sensor initialization errors appearing in the log are okay, since they refer to a stereo camera not installed on your board.

He recommended two things:

  • Try camera-test -f optic in the startup script you are using to see if the sensor is functional at boot up.
  • Also, he recommend moving to the latest Intrinsyc release of the platform image (3.1.3.1).

Jim W.

jywilson avatar Sep 15 '17 02:09 jywilson

@jywilson Thanks for coming back to this.

Also, he recommend moving to the latest Intrinsyc release of the platform image (3.1.3.1).

This is 3.1.3.1 already

Try camera-test -f optic in the startup script you are using to see if the sensor is functional at boot up.

There are no issues when I replace

cd /home/linaro/src/snap_cam/build
./optical_flow -f 90 -a

with qcamvid -c optic -r vga -s -t 600 or camera-test -f optic.

Could anyone ever reproduce this issue?

ChristophTobler avatar Sep 15 '17 12:09 ChristophTobler