This device is a way to control your ros based robots, I tried to make it as complete as my resources at that allow it, the functionalities that it already has are:
- Serial port through Bluetooth.
- Fusion sensor IMU 9 dof, degree output alignment with earth's magnetic field.
- 3 buttons, 1 joystick, and gripper control.
- Rechargeable.
The controller is based in the ESP32 Devkit V1 board that has Wifi/Bluetooth and can be programmed with Arduino, this allows to be implemented easily with the ROS architecture because the board, after being connected through the serial port, is seeing as a node.
The idea was that the controller must be ease to program, for that I used Arduino (full program available in the files section), so here are an explanation of the parts of the code that I considered more useful to understand and, of course, a general review of all the code.
The first part are de libraries used:
By default ros in the ros serial examples the TX/RX in the IC handle the nodes connections, but is possible to change that defining a new class and using it in the ros::NodeHandle declaration:
The function that fill the variables with data is:
The last part is:
So that's all, if you have any question just ask in the comments.