Repository to learn to use plataformio_microros with the ESP32 DEV KIT miccrocontorller.
- Operating system: Ubuntu 22.04
- Robotic Frameworks:
- Microcontroller Framework: Micro-ROS
- IDE: PlatfotmIO on Visual Studio Code
- Microcontroller: ESP32 DEV KIT
sudo apt-get install python3-venv
install the repository as a platformIO project:
Note: if the micro_ros_platformio doesn't install, comment any ROS pkg source in your .bashrc, like this:
# Setup ROS2
#source /opt/ros/humble/setup.bash
#source /opt/vulcanexus/humble/setup.bash
Delet the /.pio/libdeps/esp32doit-devkit-v1/micro_ros_platformio folder and restart the computer.
Open the proyect with VSC again, the microros_ros_platformio should install correctly.
One you are ready with the turorials checks the examples:
- Publisher, subscriber and timer
- Publisher, subscriber and timer with wifi
- Motor control by subscriber
- Encoder publisher
Go to your platformio.ini file to set the build_src_filter:
build_src_filter = +<examples/pub_sub_timer/*> -<.git/> -<.svn/>
Now compile and upload the firmware.uf2 file to raspberry PI pico, use the one that is inside the .pio/build/pico/ folder.
Find your serial [device name]:
ls /dev/serial/by-id/*
Add access to USB port
sudo chmod a+wr [device name]
Start micro_ros_agent:
ros2 run micro_ros_agent micro_ros_agent serial --dev [device name]
visualice msgs with ros Qt tools
rqt
Turn down the LED low
ros2 topic pub /micro_ros_subscriber std_msgs/msg/Int16 data:\ 0\
Turn down the LED high
ros2 topic pub /micro_ros_subscriber std_msgs/msg/Int16 data:\ 1\