GithubHelp home page GithubHelp logo

petoicamp / petoicontrollerqt Goto Github PK

View Code? Open in Web Editor NEW
22.0 5.0 8.0 7.73 MB

Connect and communicate with Bittle through serial with Qt 5

License: GNU General Public License v3.0

QMake 0.48% C++ 94.79% C 4.62% Shell 0.11%

petoicontrollerqt's Introduction

What's this?

This is a serial controller for Petoi's devices such as Bittle.

This project was written with Qt5, therefore you can easily deploy it on your PC/MacOS/Linux.

What could it do?

After you build the application on your PC, you will be able to control the robot, such as calibrating the servos of Bittle, and triggering some skills, such as running, jumping, walking, etc.

This project extends the functionality and user interaction of Bittle. It can also serve as a demo for developers who wants to fully explore Bittle's possibilities.

Are there any third-party libraries required?

Only Qt5 is needed. No need to install any third-party libraries. You can clone this repository and build it on your local machine.

Qt Official Website

https://www.qt.io/

Getting start with Qt

https://resources.qt.io/development-topic-getting-started-with-qt

Program Downloads

Download the latest Windows or Mac programs.

Instructions on the current UI

Change Language

The default interface is in Chinese.

Default UI

You can switch to English by clicking File/Language/English from the menu.

Change Language Supports

Connect to Bittle

Before playing with Bittle, you need to correctly plug the Bluetooth module or USB module to the 6-pin socket on the NyBoard. The LED on the module will turn on after inserted into the 6-pin socket.

Click the Refresh button, let the app search the available serial ports on your PC.

After 1~2 seconds, you will see a list of the available Serial Ports.

Selector

The other configurations, such as baud rate, stop bits, data bits and parity should remain default. You don't need to modify their values.

For MacOS user:

USB Serial

You can connect Bittle with the USB serial module. Plug the USB module to Bittle, and connect it to your PC through the USB cable. Click the Refresh button, and a port called "usbserialXXXX" should appear in the Port Number drop menu.

Bluetooth

When Bittle starts up, the LED on the module should blink, meaning it's ready for connection. Find the device in your computer's Bluetooth setting, and enter 0000 (or 1234) as the pin code. The LED should go steady. After that, click the Refresh button. Something named like "cu.PetoiSerial" should appear in the Port Number drop menu.

For Windows user:

Whether you use the USB module or the Bluetooth module, the items in the "Port Number" list are named as "COM#". You have to test each COM port from the list and click Connect to validate. You can also unplug the module and check which port disappeared. Then you will know the corresponding COM number.

After connecting to the port, the main program will reset and play the booting music. Some message will be printed in the textbox, meaning you have successly connected to Bittle.

Success

Calibration

Before you play with Bittle, one important thing you have to do is calibration.

Click the Start button to enter the Calibration mode. The app needs a few seconds to communicate with Bittle and get its servos' calibration angles.

Calibration

After you've seen the output as shown in the above picture, you need to click the Read button to get the saved calibration values from Bittle.

Make sure every servo is in the right position. You can use the L- shaped ruler to help you calibrate. The servos on Bittle are indexed as shown on the right side of this app.

Do calibration

After calibrating all the servos, remember to click the Save button to save the updated angles and the app will synchronize with Bittle.

Play with Bittle

You only need to calibrate Bittle for once. Next time, you can just click the Action tab.

Actions

Now you can play with Bittle with actions show above.

Play more!

Want to control Bittle like a remote controlled car?

forward: w

backward: s

turn left: a

turn right: d

run-forward: shift + w

run-left: shift + a

run-right: shift + d

crawl forward: ctrl + w

crawl left: ctrl + a

crawl right: ctrl + d

Too slow?

Click the Gyro off button, and see what happens?

petoicontrollerqt's People

Contributors

seagochen avatar

Stargazers

 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

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.