Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to synchronize time between micro ros and ros2 #1883

Closed
flux0-0 opened this issue Nov 29, 2024 · 7 comments
Closed

Unable to synchronize time between micro ros and ros2 #1883

flux0-0 opened this issue Nov 29, 2024 · 7 comments

Comments

@flux0-0
Copy link

flux0-0 commented Nov 29, 2024

This is my code " https://github.com/flux0-0/test_microros_time/blob/main/main.cpp " . If I upload it to Esp32, I don't see anything printed in the serial. This is my ini file " [env:esp32doit-devkit-v1]
platform = [email protected]
board = esp32doit-devkit-v1
framework = arduino

monitor_speed = 115200
monitor_rts = 0
monitor_dtr = 0
monitor_port = /dev/ttyUSB0

board_microros_distro = humble
board_microros_transport = wifi
lib_deps =
https://github.com/micro-ROS/micro_ros_platformio
paulstoffregen/Time@^1.6 "

@hippo5329
Copy link

"About UART1 (GPIO 9 and GPIO10) – these GPIOs are connected to the ESP32 SPI flash memory, so you can’t use them like that. To use UART1 to communicate with other devices, you must define different pins using the HardwareSerial library. "

https://randomnerdtutorials.com/esp32-uart-communication-serial-arduino/

@flux0-0
Copy link
Author

flux0-0 commented Nov 30, 2024

Tks, I have tried a lot but I failed. Can you give me an example code about synchronous time in micro ros and ros2 with framework adruino ?

@hippo5329
Copy link

@flux0-0
Copy link
Author

flux0-0 commented Dec 2, 2024

I've read and followed, but it seems my counter always starts at 0. This is my code "https://github.com/flux0-0/test_microros_time/blob/main/main.cpp" I hope you will read and help me point out any errors!

@hippo5329
Copy link

There are a lot of things to learn. Coding, debugging, micro-ros re-connection, timer..etc. It takes time to learn. No short-cut. I would suggest follow the wiki and try out.

https://github.com/hippo5329/linorobot2_hardware/wiki

@hippo5329
Copy link

You can try out with a bare esp32. No real robot or sensor is needed.

Then start over with the re-connection example. Change the message to a dummy stamped one. The add time sync. Do these step by step.

@flux0-0
Copy link
Author

flux0-0 commented Dec 11, 2024

Thanks for your help, I fixed it successfully

@flux0-0 flux0-0 closed this as completed Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants