Skip to content

Commit

Permalink
Merge pull request #13 from arduino-libraries/devel
Browse files Browse the repository at this point in the history
0.4.0 rc1
  • Loading branch information
gbr1 authored Mar 12, 2024
2 parents bd664bd + 7fedbcd commit 92f4d21
Show file tree
Hide file tree
Showing 8 changed files with 58 additions and 53 deletions.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,24 @@
# Arduino_AlvikCarrier


W.I.P.
This library is used to build the firmware required for Arduino® Alvik Carrier.

To use the library, [stm32duino](https://github.com/stm32duino/Arduino_Core_STM32) is required.

<br>
<br>

## Build parameters
```
Board: Generic STM32F4
Board part number: Generic F411RCTx
```

To flash the firmware use the Arduino® Alvik documentation.

<br>
<br>

## Useful links
- [Product page](https://store.arduino.cc/pages/alvik)
- [Micropython](https://github.com/arduino/arduino-alvik-mpy)
3 changes: 1 addition & 2 deletions examples/firmware/firmware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
*/

// WIP -> preliminary firmware
// This is the stock firmware of Arduino Alvik robot.


#include "Arduino_AlvikCarrier.h"
Expand Down Expand Up @@ -61,7 +61,6 @@ uint8_t version[3];


void setup(){
Serial.begin(115200);
alvik.begin();
alvik.disableIlluminator();
alvik.setLeds(COLOR_ORANGE);
Expand Down
37 changes: 18 additions & 19 deletions examples/imu/imu.ino
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,31 @@ unsigned long time_imu_update=0;
Arduino_AlvikCarrier alvik;

void setup(){
Serial.begin(115200);
alvik.begin();
time_imu_update=millis();
}

void loop(){
if (millis()-time_imu_update>100){
alvik.updateImu();
Serial.print("\t");
Serial.print(alvik.getAccelerationX());
Serial.print("\t");
Serial.print(alvik.getAccelerationY());
Serial.print("\t");
Serial.print(alvik.getAccelerationZ());
Serial.print("\t");
Serial.print(alvik.getAngularVelocityX());
Serial.print("\t");
Serial.print(alvik.getAngularVelocityY());
Serial.print("\t");
Serial.print(alvik.getAngularVelocityZ());
Serial.print("\t");
Serial.print(alvik.getRoll());
Serial.print("\t");
Serial.print(alvik.getPitch());
Serial.print("\t");
Serial.println(alvik.getYaw());
alvik.serial->print("\t");
alvik.serial->print(alvik.getAccelerationX());
alvik.serial->print("\t");
alvik.serial->print(alvik.getAccelerationY());
alvik.serial->print("\t");
alvik.serial->print(alvik.getAccelerationZ());
alvik.serial->print("\t");
alvik.serial->print(alvik.getAngularVelocityX());
alvik.serial->print("\t");
alvik.serial->print(alvik.getAngularVelocityY());
alvik.serial->print("\t");
alvik.serial->print(alvik.getAngularVelocityZ());
alvik.serial->print("\t");
alvik.serial->print(alvik.getRoll());
alvik.serial->print("\t");
alvik.serial->print(alvik.getPitch());
alvik.serial->print("\t");
alvik.serial->println(alvik.getYaw());
}
delay(1);
}
23 changes: 11 additions & 12 deletions examples/kinematics/kinematics.ino
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ uint8_t task=0;
bool led_value = false;

void setup() {
Serial.begin(115200);
alvik.begin();
ttask=millis();
tmotor=millis();
Expand All @@ -35,17 +34,17 @@ void loop() {
tmotor=millis();
alvik.updateMotors();
alvik.updateKinematics();
Serial.print("\t");
Serial.print(alvik.getLinearVelocity());
Serial.print("\t");
Serial.print(alvik.getAngularVelocity());
Serial.print("\t");
Serial.print(alvik.getX());
Serial.print("\t");
Serial.print(alvik.getY());
Serial.print("\t");
Serial.print(alvik.getTheta());
Serial.print("\n");
alvik.serial->print("\t");
alvik.serial->print(alvik.getLinearVelocity());
alvik.serial->print("\t");
alvik.serial->print(alvik.getAngularVelocity());
alvik.serial->print("\t");
alvik.serial->print(alvik.getX());
alvik.serial->print("\t");
alvik.serial->print(alvik.getY());
alvik.serial->print("\t");
alvik.serial->print(alvik.getTheta());
alvik.serial->print("\n");
}

if ((millis()-ttask>5000)||alvik.isTargetReached()){
Expand Down
13 changes: 2 additions & 11 deletions examples/motor/motor.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*/

// This example shows how wheels velocity control can be used


#include "Arduino_AlvikCarrier.h"

Expand All @@ -21,15 +23,10 @@ int status=0;
float reference = 0.0;

void setup(){
Serial.begin(115200);
alvik.begin();
t=millis();
t_change=millis();
alvik.setRpm(reference,reference);

Serial.print("reference");
Serial.print(" ");
Serial.println("measure");
}

void loop(){
Expand Down Expand Up @@ -64,11 +61,5 @@ void loop(){
if (millis()-t>20){
t=millis();
alvik.updateMotors();

Serial.print(reference);
Serial.print(" ");
Serial.print(alvik.getRpmRight());
Serial.print(" ");
Serial.println(alvik.getRpmLeft());
}
}
7 changes: 2 additions & 5 deletions examples/position/position.ino
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
*/

// This example shows how left wheel position control can be used


#include "Arduino_AlvikCarrier.h"

Expand All @@ -20,7 +22,6 @@ uint8_t task=0;
float reference;

void setup() {
Serial.begin(115200);
alvik.begin();
task = 0;
reference = 0;
Expand All @@ -32,10 +33,6 @@ void loop() {
if (millis()-tmotor>20){
tmotor = millis();
alvik.updateMotors();
Serial.print(reference);
Serial.print("\t");
Serial.print(alvik.getPositionLeft());
Serial.print("\n");
}

if (millis()-ttask>5000){
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=Arduino_AlvikCarrier
version=0.3.4
version=0.4.0
author=Arduino, Giovanni di Dio Bruno, Lucio Rossi
maintainer=Arduino <[email protected]>
sentence=Library and firmware for Arduino Alvik Carrier board
Expand Down
4 changes: 2 additions & 2 deletions src/definitions/robot_definitions.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,8 @@ const float MOTION_FX_PERIOD = (1000U / MOTION_FX_FREQ);

// Library version
#define VERSION_BYTE_HIGH 0
#define VERSION_BYTE_MID 3
#define VERSION_BYTE_LOW 4
#define VERSION_BYTE_MID 4
#define VERSION_BYTE_LOW 0



Expand Down

0 comments on commit 92f4d21

Please sign in to comment.