Giter VIP home page Giter VIP logo

solodevguide's Introduction

Solo Developer Guide

Build Status Circle CI

This guide is published online at: dev.3dr.com

To start editing, install GitBook (requires Node.js):

npm install grunt-cli -g
npm install gitbook-cli -g
npm install
gitbook install book

Build once with grunt:

grunt

Then view it locally:

gitbook serve book

Open http://localhost:4000/. Files will update live as you edit them.

See CONTRIBUTING.md for information on how to submit to this guide.

License

CC BY 4.0

solodevguide's People

Contributors

aagbabiaka avatar chasesutton avatar dmoroni avatar franknitty69 avatar hamishwillee avatar jonasvautherin avatar kellegous avatar liamstask avatar mrpollo avatar njoubert avatar oxinarf avatar peterbarker avatar tcr3dr avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

solodevguide's Issues

SmartShot example that uses Flip mode

This was Randy's idea.

Have a "flip" smart shot that responds to a button press to go into FLIP mode!

This is your "dead simple" Smart Shot example, but it doesn't use extensively smart shot code. So maybe this is a dedicated example using buttons.

Rename "sdg" tool to "solo-utils", Installer

We need a better name for the "sdg" utility. Probably "solo-utils" is easy enough.

Do we want parity with "sololink-config" in any way?

We also need an installer for "sdg" that is simpler than cloning a Github repo. Probably downloading a shell script is easy.

How do you use gstreamer downstream?

e.g.

modprobe mxc_v4l2_capture; gst-launch mfw_v4lsrc ! <YOURPIPELINE>

If you want to use Gstreamer to access the stream:

if so, disable the VID line in /etc/inittab, restart the copter

then you can get access to the incoming video stream with “modprobe mxc_v4l2_capture; gst-launch mfw_v4lsrc ! "

Versioning and Updating the Guide

The easiest proposal for updating the guide is an "evergreen" strategy:

The 3DR Dev Guide is updated with new content on a rolling basis, and always targets the latest release of Solo.

Are there other things to consider?

/cc @mrpollo @bbasso

How to contribute to this repo?

I have a great document in mind how do I contribute?, should we append to README.md or create a new file and add it to the Table of Contents of README.md?

Expand on Stillframe Photo API example

We want this to include a REST API, actual Python libraries, and to leverage gstreamer clipping from /dev/video2/.

If at all possible, let's do this in-memory too instead of using the filesystem (thanks Dan for the idea!).

Reading Solo system logs

We need a section in "Troubleshooting" about reading and consuming Solo system logs.

  • What process monitors logs? (syslogd?)
  • Where are logs located? (/log/ ?)
  • What processes generate what logs?
  • What happens when the log directory is full?

ShotManager next steps

checklist for smartshots

  1. can smartshot repo be public?
  2. split out via bitbake
  3. split out via git
  4. testing setups
  5. repackager
  6. refactor
  7. public guides on modifying
  8. done

got a few things to do in opencv

  1. patch the v4l2-utils
  2. patch the x264

How do I simulate Solo

This is composed of several parts:

  1. SITL (drone)
  2. Artoo
  3. Sololink
  4. Map view
  5. Mobile App

https://github.com/3drobotics/donkeykong simulates several of these but isn't yet dev-ready.

Eric documented his full setup for simulation, but we should work on creating something easy to be used by partners.

Some of the instructions make a few assumptions

Accessing Solo

When Solo and its controller are booted, it creates a private network between the two devices over WiFi. Any computer or smartphone can connect to this network and access these devices by their IP addres

  • What is "Solo". What is the "Controller"?
  • We don't mention SDG here. Isn't it a main mechanism for accessing Solo?

Utilities

  • This has inconsistent naming - utilities in page and "The SDK Utilitie" in sidebar. I would expect it the other way round (large version in page)
  • This states "There are several scripts ". But we only refer to one - SDG
  • The first sentence isn't quite a introduction to the bullet points. So it says "There are several scripts that we will be using throughout this tutorial that are packaged as a folder of shell scripts." but ideally it would then have a sentence "The most important of these is sdg, which is used to:"
  • I'd also like to clarify the last point "Tunnelling to the Internet through your host.". So what I think you do is SSH into Solo (or controller?) and then you can use sdg to tunnel back out of SOLO to the internet through your host.

Installing Files and Code

After having installed the sdg tool, from ..
...
This tunnels an Internet connection to Solo through your computer.

It is not clear to me from previous information whether this is something you install on SOLO or on the computer. If it is on Solo, then the last sentence would perhaps be more accurately "tunnels an Internet connection FROM solo .."

in section "Bundling Python code"

This mechanism bundles Python code locally on your computer and expands it in a virtual environment on Solo

Perhaps "This section shows how you can bundle Python code locally and expand it ...". A minor point, but when you refer to "This mechanism", I was looking for a mechanism that had previously been referred to.

entire directoy we s

Typo "directory"

The docs are really good. Wouldn't hurt to run a spell checker and do minor technical subedit.

How do I create a new smartshot?

Aside from editing cable_cam.py and pretending it's a new smartshot.

How do I enable smartshots outside the app, for non-iphone control? (if this is necessary; we know how to do it, but)

Hosting packages

Many of the examples now use packages as generated by Yocto, since this is a natural development pattern.

We must decide between two options:

  1. Do we host only the "unique set" of packages useful for development, or
  2. Do we host the entire package repository as generated by Yocto?

Solo can deal with either. Generating the "unique set" is difficult as it implies a whitelist of packages that is not easy to determine except with a stock Solo. Hosting the entire package repository implies that we have accessible packages for all code running on Solo.

Track analytics

We want a way to track the success of SDG and ongoing results.

  • track globally

External resources section

Would it make sense to include a section that includes external links to sites and forums that already exist and contain resources for developing on pixhawk? It may not make sense to link out once this is more built out, but for new developers this could be a good resources to help them navigate the open source world that already exists.

How do I access the Internet from Solo?

You can use sshuttle (a Python-based proxy that leverages iptables) to reach the Internet.

./sshuttle -H -r [email protected] 0/0 -vv  --seed-hosts google.com,www.google.com

You'll need to be able to SSH from Solo to your host computer. Do this in one SSH connection and load another SSH connection to work with the proxied service.

Note that only TCP traffic is tunnelled, not ping, ICMP, etc.

How to install runit

WIP:

#!/bin/bash
# install-runit
# This script will install runit as a process spawned by /etc/inittab
# to monitor services under /etc/solo-services under runlevel 4

# This function ensures that a line exists in a given file.
# If it doesn't, it adds it.
lineinfile () {
FILE=$1
LINE=$2
grep -q "$LINE" "$FILE" || echo "$LINE" >> "$FILE"
}

# First create the directory where our services will live.
mkdir -p /etc/solo-services

# We require a script called /sbin/solo-services-start.
# This will be launched on startup as a long-lived process
# (under runlevel 4) that monitors the /etc/solo-services
# directory and respawns services that live there.
# Lookup runsvdir(8) for more information on how this works.
cat <<'EOF' > /sbin/solo-services-start
#!/bin/sh

PATH=/usr/local/bin:/usr/local/sbin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/X11R6/bin

exec env - PATH=$PATH \
runsvdir -P /etc/solo-services "log: $(printf '.%.0s' {1..395})"
EOF
chmod +x /sbin/solo-services-start

# We add /sbin/solo-services-start as a startup script.
lineinfile "/etc/inittab" "SSS:4:respawn:/sbin/solo-services-start"

# Tell the OS to re-read /etc/inittab and immediately
# launch all services.
init q

Have the Controller able to talk to a wifi network

This would replace the crude "tunnel" system.

The Controller has the capacity to act not only as an AP (allowing Solo to connect to it) but also as in STA mode (connecting to a different wifi network). This is enabled through /etc/sololink.conf and the configuration can happen from the command line.

The next step is configuring NAT so that Solo can act as though it were connected to the network as well.

Lastly, we need to the capacity to change this wifi network from Solo, possibly by SSHing into Artoo. Do we hardcode this configuration, so Solo always tries to connect to a specific Wifi network?

Warn on "advanced topics"

Until we have proper instruction on how these will be presented, we may want to hide them entirely.

Branding 3DR Developer Guide

We have a rudimentary style based off of the default Gitbook theme. This lives in the ./theme directory.

We used the default theme from Gitbook as a base. You can see the tag "tag-gitbooktheme" is when this theme was copied over as a dependency.

Modifications have been made since as a POC for a header / footer. We have control over SASS, HTML, and JS on the site. For now, these are published statically to S3, so no dynamic backend assets.

  • 3DR branded header
  • Links to forums, support, feedback
  • Set up appropriate URL
  • Nginx server #48

How does our video pipeline work?

Video pipeline:

GoPro -> HDMI cable -> HDMI encoder -> i.MX6 (h.264 encode/gstreamer) -> WiFi (UDP) -> Artoo (h.264 decode/hdmi output/UDP relay to phone) -> WiFi (UDP) -> App

Hardware Content for Release

We want to flesh out the hardware content of the guide.

Dan Moroni, can you write up a list of content that would be considered necessary for public release?

pip instructions are not clear enough

on the Installing packages directly with pip section we don't really cover installing packages with pip we are only showing a how to install pip script

I propose 2 subsections:

  • How to install pip
  • How to install a package using pip

Support v4l2sink splitting of /dev/video0 to /dev/video[12] OOB

This is a huge blocker on other elements of the system and needs to be fixed asap.

Going to work with the dedicated Solo package manager and see if this works with the provided instructions.

Next, update the instructions to document (Yocto info?) how this is set up.

Finally, add sdg install-videosink.

How do I disable the Gimbal?

Turn the machine upside down.

if you use the `GMB_K_RATE` you also need to set `GMB_CUST_GAINS`  to `1.0`
setting it back to `0.0` will get you back your gains

How do we do package management?

We use rpm on Solo. There's also the smart package manager which can be used to download from a repository. (How do you connect that to Solo though?)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.