Skip to content

Commit

Permalink
Fixing LED error report, removing comments
Browse files Browse the repository at this point in the history
  • Loading branch information
danilo-pejovic committed Oct 18, 2023
1 parent 8e4a8a1 commit e3dcf1f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 7 deletions.
2 changes: 1 addition & 1 deletion rae_bringup/scripts/battery_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def listener_callback(self, msg):
led_msg = LEDControl()
led_msg.header.stamp = self.get_clock().now().to_msg()
led_msg.data = [ColorRGBA(r=0.0, g=0.0, b=0.0, a=0.0)]*40
for i in range(40):
for i in range(39):
led_msg.single_led_n = 0
led_msg.control_type = 2 # assuming 0 means "set color"

Expand Down
2 changes: 1 addition & 1 deletion rae_bringup/scripts/led_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def listener_callback(self, msg):
led_msg = LEDControl()
led_msg.header.stamp = self.get_clock().now().to_msg()
led_msg.data = [ColorRGBA(r=0.0, g=0.0, b=0.0, a=0.0)]*40
for i in range(40):
for i in range(39):
led_msg.single_led_n = 0
led_msg.control_type = 2
if i < 8:
Expand Down
2 changes: 1 addition & 1 deletion rae_hw/include/rae_hw/peripherals/led.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#include "rae_msgs/msg/led_control.hpp"

#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
#define WS2812B_NUM_LEDS 40
#define WS2812B_NUM_LEDS 39
#define WS2812B_RESET_PULSE 60
#define WS2812B_BUFFER_SIZE (WS2812B_NUM_LEDS * 24 + WS2812B_RESET_PULSE)

Expand Down
6 changes: 2 additions & 4 deletions rae_hw/src/rae_motors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ namespace rae_hw

float RaeMotor::calcSpeed()
{
// while (_running)
// {

// Get current position and time different and caluclate the speed
auto currTime = std::chrono::high_resolution_clock::now();
float currPos = getPos();
float timeDiff = std::chrono::duration<float>(currTime - prevVelTime).count();
Expand All @@ -67,8 +67,6 @@ namespace rae_hw
}
prevVelTime = currTime;
prevPos = currPos;
// std::this_thread::sleep_for(10ms);
//}
return currentSpeed;
}

Expand Down

0 comments on commit e3dcf1f

Please sign in to comment.