A Sublime Text plugin for NAOqi Python API used by Aldebaran Robotics NAO robot
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
naoqi_v0-12
LICENSE
README.md
naoqi.sublime-completions
naoqi_documentation_crawler_v0-1.py
naoqi_documentation_crawler_v0-11.py
naoqi_documentation_crawler_v0-12.py
naoqi_documentation_crawler_v0-13.py
naoqi_v0-12.sublime-package

README.md

<h1>naoqi Sublime Text 2 plugin package</h1>

A plug-in package for Sublime Text 2 (http://www.sublimetext.com/) for writing NAOqi Python API code for Aldebaran Robotics NAO robot (http://www.aldebaran-robotics.com/). Allows you to write NAOqi Python on Mac OS X, Linux and Windows in a very clean and fast text editor. Can then be used in Choregraph or run directly on NAO.

Functionality

The plug-in provides the following functionality:
  1. Python syntax color formatting via the Command Palette.
  2. Basic NAOqi Python code snippets via the completions list.
  3. Auto-complete of NAOqi methods via the completions list.
  4. Search for relevant NAOqi classes, methods and 'frameworks' (Core, Motion, Audio, Vision, Sensors, Trackers, ConnectionManager) via the completions list.
  5. Tabbed completion of method arguments after a method with arguments selected.
  6. Currently for NAOqi v1.14, but there is a Python documentation crawler included if you want to build completions for another version of NAOqi.
e.g. if you want to know what methods are available to do with speech, start typing 'ALTextToSpeechProxy', you will probably only need to type 'ALTe' (plus hit CTRL+Space if completions window not enabled) and you will see all the methods for ALTextToSpeechProxy.

Installation:

  1. Download naoqi_v*-*.sublime-package
  2. Copy naoqi_v*-*.sublime-package to ~/Library/Application Support/Sublime Text 2/Installed Packages on Mac OS X. There are Linux and Windows installation instructions at http://docs.sublimetext.info/en/latest/extensibility/packages.html
  3. Start Sublime Text and the package should auto-install.
There are a few ways to check this, the easiest is to open the Command Palette and type 'syntax' and look for 'naoqi' in the list. Once the code is a bit better I will get it registered to install with the excellent Package Control (http://wbond.net/sublime_packages/package_control)

Usage

Once naoqi syntax selected from the Command Palette. The main naoqi functionality is in the methods, classes and 'frameworks' completion list.
  1. To auto-complete a method, class or snippet, start typing a method name, class name or code snippet name using lower case and access the completions list with CTRL+spacebar. Each argument within a method can be jumped between with the TAB key.
  2. To search for all the methods and classes within a 'framework' (Core, Motion, Audio, Vision, Sensors, Trackers, ConnectionManager), start typing a 'framework' name in UPPER case e.g. 'VISION' will list all the commands related to the Vision APIs.
  3. To search for an event within a 'framework' (Core, Motion, Audio, Vision, Sensors, Trackers, ConnectionManager), type 'EVENT' to see a complete list of events, or type the framework name in upper case to show all methods and events for that framework. Or just start typing the name of the event to get a completion.

To create your own completions

  1. If you wish to make your own completions file e.g. for older or newer versions of NAOqi.
  2. My crawler may not be robust enough yet until re-written and tested on other versions of the documentation.
  3. Download the version of the documentation you need. (It's just a bit quicker than a web crawl.)
  4. Get 'naoqi_documentation_crawler.py' from my Github page https://github.com/mikemcfarlane/naoqi_sublime_text_plugin
  5. You will need Beautiful Soup 4 library http://www.crummy.com/software/BeautifulSoup/
  6. Edit the 'PATH' variable in the function 'get_html_file_list' in naoqi_documentation_crawler.py, it should point to the folder 'naoqi' within the downloaded folder.
  7. In the terminal run 'python naoqi_documentation_crawler.py'.
  8. Move the resulting 'naoqi.sublime-completions' file into the Sublime Text plugin directory from above.
  9. Go code:-)

Versions:

  • 0.1 - getting something working, using NAOqi v1.14.
  • 0.12 - add events

To do:

  1. Add events, HIGH PRIORITY - DONE
  2. Methods in alphabetical order, HIGH PRIORITY
  3. Needs to highlight or remove deprecated methods.
  4. Current snippets are standard Python ones, so they need checked.
  5. More NAOqi snippets needed, the only one currently is 'choregraph box'. Email me any you want included.
  6. Documentation crawler needs re-written to be more robust using Beautiful Soup.
  7. Have a think about the C++ API.
  8. The completions window is quite small, and not configurable, so need to optimise display of info.
  9. Maybe show a methods arguments in the completions window, for clarity, and as some class::methods are similar. Completions window small and non-configurable, and needs also to differentiate methods and events, so need to keep compact.
  10. Submit to Sublime Package Manager once stable
  11. Possible to include link/jump to documentation?

Bugs:

Report to 'mike >-at-< mikemcfarlane >-dot-< co >-dot-< uk' or discuss on Aldebaran forum thread.
  1. Not showing arguments for some methods. - fixed tbc

Attribution:

  1. Uses standard Sublime Text Python package and snippets as a base.
  2. Uses NAOqi documentation created by Aldebaran Robotics.

License:

MIT