top of page

Forum Posts

Struzck
Jun 08, 2021
In General Discussions
Hi, is there any changelog where new updates are recorded so we can check whats new about Bittle code? I mean a detailed changelog (not like github's commit comments).
0
3
30
Struzck
Jun 03, 2021
In Software
Hi, I'm trying to develop an obstacle avoidance feature for the XboxController program I made. The first step is adding the distance measurement function in the code (I'm using Grove ultrasonic sensor); I placed it within the loop function, after GYRO calculations: But it makes Bittle unable to walk (it moves its limbs just a little bit and very slowly) so I think thats not the best place to place the code; where should I put the sensors output to avoid influencing Bittle behaviour and movement? Got any tips for using sensors? such as how much delay to use, how to send through serial properly...
Where to place sensors measurement output in the code? content media
0
4
69
Struzck
May 15, 2021
In Basic Assembly and Setup
Hello, I'm trying to attach Grove ultrasonic ranger to Bittle, for that I'm following this guide: https://www.yuque.com/tinkergen-help-en/bittle_course/sensor_pack_lesson_4, in which there is a picture of Bittle with the ranger: I'm unable to make Bittle hold the ultrasonic sensor that way, is there a photo of Bittle holding it taken from a different angle or any other alternatives to attach the sensor to Bittle? In that picture, the way Bittle is holding the sensor is the same as this?: Thanks
Attaching Grove Ultrasonic ranger to Bittle's head? content media
1
2
154
Struzck
May 08, 2021
In Software
Hello, I will be posting here all the feedback about QtController. I have been playing around with this software a bit today and these are my first impressions so far: · As chosen language is not saved between sessions, I think english should be set by default, as all of us can understand it, but not chinese. · I found a bug when using the calibration tool. I had previously modified my Bittle's code to print some debugging messages, this caused a fatal error on "calibrationFeedbackCheck". The expected input was something like this: calibrationFeedbackCheck: "c" ----> "\r\n0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,\r\n0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,\r\n" But instead, because of my debugging print, received the following: It seems the bug is located on line 93 of SerialCmdStack.cpp. I think there are two possible ways to solve this: the first one is verifiying all received serial data before processing it (as any of us can modify our own Bittle's code and make it print/send any kind of message), this is probably too inneficent or just unmanageable; the other solution would be making sure people know that this software is only compatible with default/official Bittle code (adding it to Readme should be enough). · I think there should be some kind of feedback when trying to connect to Bittle through Bluetooth. I selected the default shown port, pressed "Connect" and waited for a while before realising I had chosen a wrong port number. Maybe you could add a connection timeout to let people know that connecting to Bittle wasn't achieved. · I think its necessary to add a way to protect Bittle from sending a lot of commands in a short period of time. I tried sending many movement commands at once (pressing awsd randomly) and it caused Bittle to fail. I already faced this problem while developing the Android app and the XboxController app and the only solution I have though of so far is adding a delay to user input, but there must be better ways to prevent this. · If you plan to allow saving the connection settings (Baud Rate, Stop Bit, etc) between sessions, it would be great if default values were listed on Readme, just in case someone modifies it by mistake and cant remember the default values. Adding a "Reset" button could be enough. This is what I have found so far, Im sure you already have though of many of the things I listed, hope this is useful.
Feedback on QtController content media
0
0
40
Struzck
May 02, 2021
In General Discussions
Hello, I have been testing the WiFi dongle by sending commands and I found that after sending several of them Bittle gets blocked and won't listen to any other command I send, being necessary to reboot it. When this occurs, gyroscope seems to be disabled and using the IR controller won't work neither. It also gives me the impression there is a command buffer and sometimes, when rebooting, all those commands that I have tried to send were stored and now are sent all at once to Bittle, causing it to have a weird posture. This is what I did the last time it happened to me: Turn on Bittle Wait for 30 seconds Send Sit command Send Balance command Send Forward command <-- not working anymore Has this happened to anyone else?
0
8
123
Struzck
Apr 28, 2021
In Software
Hello, I have developed this Python library that allows connecting to Bittle through Bluetooth and WiFi (and Serial communication soon) and sending commands and custom messages. pyBittle objective is keeping it simple to connect to and manage Bittle while allowing more complex operations. The library repository can be found here: github/pyBittle You can read in-depth documentation and usage examples here: gitbook/pyBittle pyBittle can be installed using the following comand: pip install pyBittle Connecting to your Bittle and sending commands to it is as simple as shown below: bittle = pyBittle.Bittle() # Create Bittle instance # Connecting through Bluetooth is_connected = bittle.connect_bluetooth() if is_connected: bittle.send_command_bluetooth(pyBittle.Command.GREETING) # Connecting through WiFi bittle.wifiManager.ip = '192.168.1.132' # Set Bittle IP address has_connection = bittle.has_wifi_connection() if has_connection: bittle.send_command_wifi(pyBittle.Command.SIT) pyBittle has been tested on Raspbian and Windows10. WiFi and Bluetooth connection are supported on Raspbian, only WiFi connection is supported on Windows10 due to pyBluez (dependency) limitations. pyBittle structure pyBittle is composed of three modules: bittleManager: High level module that allows connecting to Bittle through Bluetooth and WiFi and sending and receiving messages to control it. bittleManager contains the following classes: Bittle: This class represents your Bittle. Has a bluetoothManager and a wifiManager that allow sending messages and receive their responses from your Bittle. Command: Enum that defines avaliable commands that can be sent to Bittle (greeting, sit, pushup, balance...). Direction: Enum that defines avaliable movement directions (forward, forward left, backward...). Gait: Enum that defines avaliable gaits (walk, crawl, trot, run). bluetoothManager: Module that manages Bluetooth connection; allows finding your Bittle among paired devices, connecting to it and sending and receiving messages. wifiManager: Module that manages WiFi connection through REST API hosted in providen WiFi dongle; allows sending and receiving messages to Bittle. bittleManager is the main module, instanciating Bittle class is enough to manage and control your Bittle. Usage examples The following examples show the full process of creating a Bittle instance and communicating with it through Bluetooth and WiFi. Sending 'khi' (greet) and 'd' (rest) commands through Bluetooth: import pyBittle import time greet_command = pyBittle.Command.GREETING # 'khi' message rest_command = pyBittle.Command.REST # 'd' message bittle = pyBittle.Bittle() # Create Bittle instance isConnected = bittle.connect_bluetooth() # Search for your Bittle among paired devices and connect to it if isConnected: bittle.send_command_bluetooth(greet_command) # Send 'khi' message received_msg = bittle.receive_msg_bluetooth() # Get response from Bittle decoded_msg = received_msg.decode('utf-8') # received_msg is byte type decoded_msg = decoded_msg.replace('\r\n', '') # Remove new line from decoded_msg print(f"Received message: {decoded_msg}, expected: k") time.sleep(5) # Give Bittle few seconds to finish the sent action bittle.send_command_bluetooth(rest_command) # Send 'd' message received_msg = bittle.receive_msg_bluetooth() decoded_msg = received_msg.decode('utf-8') decoded_msg = decoded_msg.replace('\r\n', '') print(f"Received message: {decoded_msg}, expected: d") time.sleep(5) bittle.disconnect_bluetooth() # Close Bluetooth connection else: print("Can't connect to Bittle!") Sending 'kstr' (stretch) and 'ksit' (sit) commands through WiFi: import pyBittle import time stretch_command = pyBittle.Command.STRETCH # 'kstr' message sit_command = pyBittle.Command.SIT # 'ksit' message bittle = pyBittle.Bittle() # Create Bittle instance bittle.wifiManager.ip = '192.168.1.131' # Set REST API IP address if bittle.has_wifi_connection(): response = bittle.send_command_wifi(stretch_command) # Send 'kstr' message print(f"Received response: {response}, expected: 200") time.sleep(5) # Give Bittle few seconds to finish the sent action response = bittle.send_command_wifi(sit_command) # Send 'ksit' message print(f"Received response: {response}, expected: 200") time.sleep(5) else: print("Can't connect to Bittle!") Changing gait and sending movement commands: import pyBittle import time forward = pyBittle.Direction.FORWARD forward_right = pyBittle.Direction.FORWARDRIGHT stop = pyBittle.Command.BALANCE # BALANCE is Command type, not Direction type! crawl = pyBittle.Gait.CRAWL trot = pyBittle.Gait.TROT bittle = pyBittle.Bittle() # Create Bittle instance bittle.wifiManager.ip = '192.168.1.132' # Set Bittle IP address has_connection = bittle.has_wifi_connection() if has_connection: bittle.gait = crawl # Change current gait (by default, WALK) to CRAWL bittle.send_movement_wifi(forward) time.sleep(5) bittle.send_movement_wifi(forward_right) time.sleep(3) bittle.gait = trot # Change current gait (WALK) to TROT bittle.send_movement_wifi(forward) time.sleep(5) bittle.send_command_wifi(stop) # Send command, not movement (as BALANCE is Command type) time.sleep(2) else: print("Can't connect to Bittle!") Project made with pyBittle One of the Bittle-related projects I have made is BittleXboxController, which makes use of pyBittle. This project makes full use of command sending and movement management. pyBittle has been my most ambitious and serious project so far, I hope you all find it useful.
pyBittle, Open Source library to connect and control Bittle content media
5
40
1k
Struzck
Apr 22, 2021
In General Discussions
Hello, I have developed a tool that allows controlling Bittle with Xbox Controller (Xbox One controller tested). Bittle can be controlled through Bluetooth and WiFi connection. You can find it here: XboxController. How it works The controller and Bittle connect to your computer. The tool receives the inputted data from the controller, translates it to Bittle understandable commands and send to it through Bluetooth or WiFi. How to use Connect your Xbox controller to your computer (through Bluetooth or using wire). Connect your Bittle to your computer (in case you want to communicate through Bluetooth). Run BittleXboxController.py tool. Control your Bittle using the controller. To close connection and exit, press ctrl+c on the console. Buttons These are the controller buttons and its associated commands: A: BALANCE B: REST X: GREETING Y: SIT LB: STEP LR: GYRO Left pad: CRAWL Right pad: TROT Down pad: WALK Up pad: RUN Using custom controller and changing the associated commands If you want to use another controller different than Xbox One controller or to change the associated action of each button, you have to check the following lines in the code: BUTTONS_MAP= { # The numeric value corresponds to each button 0: pyBittle.Command.BALANCE, # A 1: pyBittle.Command.REST, # B 2: pyBittle.Command.GREETING, # X 3: pyBittle.Command.SIT, # Y 4: pyBittle.Command.STEP, # LB 5: pyBittle.Command.GYRO # RB } To communicate with Bittle I have used a custom library, pyBittle, that I'm currently developing and will be published here once is finished.
Using Xbox One Controller with Bittle content media
9
4
583
Struzck
Mar 21, 2021
In General Discussions
Hello, I'm trying to connect to Bittle using the included WiFi adapter but I'm facing some difficulties. First, of all, I have no previous knowledge about connecting to these kind of devices; I'm making assumptions about how it works. From what I've seen, the WiFi adapter uses a ESP-WROOM-02D module, that is based on ESP8266. It seems to be working as a Soft Access Point, so, in order to control Bittle: · I have to connect to the WiFi Network that appears as ESP-XXXXXX when I turn on Bittle. · To control Bittle, I have to send the commands to the ESP8266 module, which will comunicate through serial connection with Bittle (am I right?). Once I connect to "Bittle's network", it starts making some noises periodically. At this point is where I don't know how to proceed. I have checked that I have connection to Bittle's ip (ok). I have tried to access to Bittle's ip from a web browser, but it shows ERR_CONNECTION_REFUSED. FYI: When I try to use the IR remote controller, Bittle beeps several times quickly but doesn't react. What should I do next in order to send commands (e.g. 'kbalance') and receive Bittle's response? (I'm planning to send the commands using python, but any kind of guidance will be appreciated).
0
50
1k
Struzck
Mar 13, 2021
In Software
Hello, I have developed an Android app to control Bittle through Bluetooth. I'ts still in Beta phase, but I think it might be useful for some people. The .apk file can be downloaded from Github: https://github.com/EnriqueMoran/petoiBittleBluetoothController You can control your Bittle as if you were using the IR remote controller (it has the same buttons but calibrate). The instructions to use the App can be found in the Github repo (its very easy, just pair Bittle with your phone and control it from the App). There are a couple of issues I'm still trying to solve (related to connection). Please notice this is a Beta version and im still improving it, any suggestion is welcome. Here there are a couple of gifs using the app: If anyone need help installing the apk file, I will post a guide here.
I have developed a Bluetooth controller App content media
10
12
344
Struzck
Feb 27, 2021
In Basic Assembly and Setup
Hello, I have been assembling bittle following the instructions and, after several tries, I ended up finding this issue when validating calibration: When bittle is moving its limbs, his front-left limb won't behave like the rest. I have tried different calibrations but I'm unable to fix it (so far), so I would like to ask if this problem is due to calibration or any other cause such as battery weight (I have tried sliding it too), any problem with servos , etc. to help me understand what is happening and why. Thank you
0
3
95

Struzck

更多動作
bottom of page