Skip to content

Commit

Permalink
ros now works on QT Py
Browse files Browse the repository at this point in the history
  • Loading branch information
joshua-8 committed Jul 25, 2024
1 parent 21520d4 commit dee5ac8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
"cSpell.words": [
"Lcolor",
"Mecanum",
"microcontroller",
"microros",
"millis",
"MOSI",
Expand Down
4 changes: 2 additions & 2 deletions RCMv2/RCMv2.ino
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/**
uncomment one of the following lines depending on which hardware you have
Remember to also choose the "environment" for your board in PlatformIO
Remember to also choose the "environment" for your microcontroller in PlatformIO
*/
#define RCM_HARDWARE_VERSION RCM_ORIGINAL // versions 1, 2, 3, and 3.1 of the original RCM hardware // https://github.com/RCMgames/RCM_hardware_documentation_and_user_guide
// #define RCM_HARDWARE_VERSION RCM_4_V1 // version 1 of the RCM 4 // https://github.com/RCMgames/RCM-Hardware-V4
Expand Down Expand Up @@ -89,7 +89,7 @@ void configWifi()
void ROSWifiSettings()
{
// SSID, password, IP, port (on a computer run: sudo docker run -it --rm --net=host microros/micro-ros-agent:iron udp4 --port 8888 )
set_microros_wifi_transports("router", "password", "10.25.21.1", 8888);
set_microros_wifi_transports("router", "password", "10.25.21.1", 8888); // doesn't complete until it connects to the wifi network
nodeName = "rcm_robot";
// numSubscribers = 10; //change max number of subscribers
}
Expand Down
9 changes: 9 additions & 0 deletions RCMv2/rcmros.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,18 @@ rcl_node_t node;

void error_loop()
{
// error in ROS communication
while (1) {
#if (RCM_HARDWARE_VERSION == RCM_BYTE_V2 || RCM_HARDWARE_VERSION == RCM_NIBBLE_V1)
// bytes and nibbles have QT PYs with neopixel built in leds
delay(50);
setRSL(RSLcolor);
delay(50);
setRSL(CRGB(0, 0, 0));
#else
digitalWrite(ONBOARD_LED, !digitalRead(ONBOARD_LED));
delay(50);
#endif
}
}

Expand Down

0 comments on commit dee5ac8

Please sign in to comment.