ROS Node to interact with encoders
-
Create ros2 C++ package
ros2 pkg create --build-type ament_cmake --node-name encoders_interface encoders_interface
-
Build package
colcon build --packages-select encoders_interface
-
Source the setup file
. install/setup.bash
-
Use the package
ros2 run encoders_interface encoders_interface
-
Customize package.xml
it needs wiringPi installed in /usr/local/lib
- git clone https://github.com/WiringPi/WiringPi
- cd WiringPi
- sudo ./build
This package interact with an ESP32 board installed on the Maile Vehicle. The communication is made on I2C where the board has been setup as a SLAVE with ID:0x09. After each request the boards response with 10 bytes, 5x uint16_t values representing the 5 "delta tic" of each encoder from the last call. the encoders order is:
- spur gear motor encoder (high gear ratio = 1:5.22, low gear ratio = 1:14.45)
- front right wheel encoder
- rear right wheel encoder
- rear left wheel encoder
- front left wheel encoder
NOTES
- wheel radious = 0.559 meter
- tick for wheel / round = 12
- tick at spur gear / round = 15
This software contains code licensed as described in LICENSE.