<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.
The plug-in provides the following functionality: Functionality
- Python syntax color formatting via the Command Palette.
- Basic NAOqi Python code snippets via the completions list.
- Auto-complete of NAOqi methods via the completions list.
- Search for relevant NAOqi classes, methods and 'frameworks' (Core, Motion, Audio, Vision, Sensors, Trackers, ConnectionManager) via the completions list.
- Tabbed completion of method arguments after a method with arguments selected.
- Currently for NAOqi v1.14, but there is a Python documentation crawler included if you want to build completions for another version of NAOqi.
- Download naoqi_v*-*.sublime-package
- 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
- Start Sublime Text and the package should auto-install.
Once naoqi syntax selected from the Command Palette. The main naoqi functionality is in the methods, classes and 'frameworks' completion list. Usage
- 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.
- 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.
- 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
- If you wish to make your own completions file e.g. for older or newer versions of NAOqi.
- My crawler may not be robust enough yet until re-written and tested on other versions of the documentation.
- Download the version of the documentation you need. (It's just a bit quicker than a web crawl.)
- Get 'naoqi_documentation_crawler.py' from my Github page https://github.com/mikemcfarlane/naoqi_sublime_text_plugin
- You will need Beautiful Soup 4 library http://www.crummy.com/software/BeautifulSoup/
- 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.
- In the terminal run 'python naoqi_documentation_crawler.py'.
- Move the resulting 'naoqi.sublime-completions' file into the Sublime Text plugin directory from above.
- Go code:-)
- 0.1 - getting something working, using NAOqi v1.14.
- 0.12 - add events
- Add events, HIGH PRIORITY - DONE
- Methods in alphabetical order, HIGH PRIORITY
- Needs to highlight or remove deprecated methods.
- Current snippets are standard Python ones, so they need checked.
- More NAOqi snippets needed, the only one currently is 'choregraph box'. Email me any you want included.
- Documentation crawler needs re-written to be more robust using Beautiful Soup.
- Have a think about the C++ API.
- The completions window is quite small, and not configurable, so need to optimise display of info.
- 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.
- Submit to Sublime Package Manager once stable
- Possible to include link/jump to documentation?
Report to 'mike >-at-< mikemcfarlane >-dot-< co >-dot-< uk' or discuss on Aldebaran forum thread. Bugs:
- Not showing arguments for some methods. - fixed tbc
- Uses standard Sublime Text Python package and snippets as a base.
- Uses NAOqi documentation created by Aldebaran Robotics.