Skip to content

Commit

Permalink
migrate to micro_ros_platformio
Browse files Browse the repository at this point in the history
  • Loading branch information
grassjelly committed Jun 6, 2022
1 parent 64a5ed1 commit e21cce4
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 47 deletions.
42 changes: 9 additions & 33 deletions firmware/platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,90 +7,66 @@
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env]
platform = teensy
framework = arduino
upload_port = /dev/ttyACM0
upload_protocol = teensy-cli
lib_deps =
https://github.com/micro-ROS/micro_ros_arduino
board_microros_transport = serial
board_microros_distro = ${sysenv.ROS_DISTRO}
lib_deps = https://github.com/micro-ROS/micro_ros_platformio
build_flags = -I ../config

[env:teensy41]
board = teensy41
build_flags =
-L $PROJECT_DIR/.pio/libdeps/$PIOENV/micro_ros_arduino/src/imxrt1062/fpv5-d16-hard/
-l libmicroros
-I ../config

[env:teensy40]
board = teensy40
lib_ignore = NativeEthernet
build_flags =
-L $PROJECT_DIR/.pio/libdeps/$PIOENV/micro_ros_arduino/src/imxrt1062/fpv5-d16-hard/
-l libmicroros
-I ../config

[env:teensy36]
board = teensy36
lib_ignore = NativeEthernet
build_flags =
-L $PROJECT_DIR/.pio/libdeps/$PIOENV/micro_ros_arduino/src/imxrt1062/fpv5-d16-hard/
-l libmicroros
-I ../config
-llibc -lc

[env:teensy35]
board = teensy35
lib_ignore = NativeEthernet
build_flags =
-L $PROJECT_DIR/.pio/libdeps/$PIOENV/micro_ros_arduino/src/mk64fx512/fpv4-sp-d16-hard/
-l libmicroros
-I ../config
-llibc -lc

[env:teensy31]
board = teensy31
board_build.f_cpu = 96000000L
lib_ignore = NativeEthernet
build_flags =
-L $PROJECT_DIR/.pio/libdeps/$PIOENV/micro_ros_arduino/src/mk20dx256
-l libmicroros
-I ../config
-llibc -lc

[env:dev]
board = teensy40
lib_ignore = NativeEthernet
build_flags =
-L $PROJECT_DIR/.pio/libdeps/$PIOENV/micro_ros_arduino/src/imxrt1062/fpv5-d16-hard/
-l libmicroros
-I ../config
-D USE_DEV_CONFIG

[env:beebo]
board = teensy31
board_build.f_cpu = 96000000L
lib_ignore = NativeEthernet
build_flags =
-L $PROJECT_DIR/.pio/libdeps/$PIOENV/micro_ros_arduino/src/mk20dx256
-l libmicroros
-I ../config
-llibc -lc
-D USE_BEEBO_CONFIG

[env:beebo_m]
board = teensy31
board_build.f_cpu = 96000000L
lib_ignore = NativeEthernet
build_flags =
-L $PROJECT_DIR/.pio/libdeps/$PIOENV/micro_ros_arduino/src/mk20dx256
-l libmicroros
-I ../config
-llibc -lc
-D USE_BEEBO_M_CONFIG

[env:square]
board = teensy40
lib_ignore = NativeEthernet
upload_port = /dev/linobase
build_flags =
-L $PROJECT_DIR/.pio/libdeps/$PIOENV/micro_ros_arduino/src/imxrt1062/fpv5-d16-hard/
-l libmicroros
-I ../config
-D USE_SQUARE_CONFIG
29 changes: 15 additions & 14 deletions firmware/src/firmware.ino
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
#include <Arduino.h>
#include <micro_ros_arduino.h>
#include <micro_ros_platformio.h>
#include <stdio.h>

#include <rcl/rcl.h>
Expand Down Expand Up @@ -87,19 +87,20 @@ IMU imu;

void setup()
{
pinMode(LED_PIN, OUTPUT);

bool imu_ok = imu.init();
if(!imu_ok)
{
while(1)
{
flashLED(3);
}
}

micro_ros_init_successful = false;
set_microros_transports();
// pinMode(LED_PIN, OUTPUT);

// bool imu_ok = imu.init();
// if(!imu_ok)
// {
// while(1)
// {
// flashLED(3);
// }
// }

// micro_ros_init_successful = false;
Serial.begin(115200);
set_microros_serial_transports(Serial);
}

void loop()
Expand Down

0 comments on commit e21cce4

Please sign in to comment.