Skip to content

Commit ee51758

Browse files
committed
Fix microros udp transprt
1 parent 7855f91 commit ee51758

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

include/rosbot_xl/config.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ inline constexpr PIDConfig pid_config = {
275275
// ───────── ROS ─────────
276276
inline constexpr const char* NODE_NAME = "rosbot_mcu";
277277
inline constexpr uint16_t DOMAIN_ID = 255; // 255 inherit from Micro ROS Agent
278-
inline constexpr uint32_t SPIN_TIME_MS = 3;
278+
inline constexpr uint32_t SPIN_TIME_MS = 1;
279279
inline constexpr uint32_t TIMER_MS = 10;
280280
inline constexpr uint16_t PING_WATCHDOG_MS = 200;
281281
inline constexpr uint16_t PING_TIMEOUT_MS = 100;

src/rosbot/ros.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ SubscriptionEntry leds_sub = {
6161
.type_support = ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, UInt8),
6262
.topic_name = "leds",
6363
.callback = ledsCallback,
64-
.best_effort = false,
64+
.best_effort = true,
6565
};
6666

6767
// Motor commands subscriber

src/rosbot_xl/ros.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ SubscriptionEntry leds_sub = {
6363
.type_support = ROSIDL_GET_MSG_TYPE_SUPPORT(std_msgs, msg, UInt8),
6464
.topic_name = "leds",
6565
.callback = ledsCallback,
66-
.best_effort = false,
66+
.best_effort = true,
6767
};
6868

6969
// LED strip subscriber

src/rosbot_xl/rtos.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,14 @@ void uRosPingTask(void* p);
6262
TaskConfig tasks[] = {
6363
{"Encoder", Priority::CONTROL, Stack::XXS, 500, encoderTask},
6464
{"HwMonitor", Priority::OBSERVING, Stack::S, 10, hwMonitorTask},
65-
{"Imu", Priority::SENSORS, Stack::M, 100, imuTask},
65+
{"Imu", Priority::SENSORS, Stack::M, 50, imuTask},
6666
{"LedStrip", Priority::COMMUNICATION, Stack::M, 30, ledStripTask},
6767
#ifndef RELEASE
6868
{"Monitor", Priority::BLOCKING, Stack::XL, 1, monitorTask},
6969
#endif
7070
{"MotorControl", Priority::CONTROL, Stack::XXS, 200, motorControlTask},
7171
{"Shutdown", Priority::OBSERVING, Stack::M, 3, shutdownTask},
72-
{"uRos", Priority::COMMUNICATION, Stack::XXL, 200, uRosTask},
72+
{"uRos", Priority::COMMUNICATION, Stack::XXL, 1000, uRosTask},
7373
};
7474

7575
TaskHandleWrapper taskHandles[sizeof(tasks) / sizeof(tasks[0])];
@@ -189,7 +189,7 @@ void ledStripTask(void* p) {
189189

190190
last_idle_change = now;
191191
}
192-
vTaskDelayUntil(&wake_time, period);
192+
vTaskDelay(period);
193193
}
194194
}
195195

0 commit comments

Comments
 (0)