Custom hardware board for four wheel steering robot
HI everyone, I am in kind of difficult position here and really, don't know how to proceed further. My issue is following, I am facing custom made hardware which does not let me to control separately each wheel RPM and each servo motor for wheel, rather it has pre-made 'maneuver' types for specific actions and I can only set the distance the robot should move and at what angle, for example:
- 'maneuver_forward' - I set distance 100 - Board sets servo values to 0 and it sets predefined RPM values for motors, and robot moves 100cm to front. The custom board already calculates the distance done by calculating wheel RPM-s and it stops after 100cm, same goes for reverse 'maneuver_reverse'
- 'maneuver_rotate' - I set degrees from -360° to +360° and custom board rotates the servo motor to etc. +30° -30° degrees and it starts the wheel motors until Gyroscope (which is on the custom board) does not rotate for set degrees.
- 'maneuver_left' - I set distance 100 - Board sets servo values of right servos to +90 and left servos to -90 and it starts the wheels, robot moves 100cm to left and stops. Same goes for 'maneuver_left' movement
- 'maneuver_translation' - I set distance and degrees - Board rotates the wheels to given degresses and move the rover for given distance.
The communication with the custom board is done over UART (60bytes long messages - using registers etc.). I can read out all 4 RPM-s value and all 4 servo values alongside absolute course (gyroscope).
My issue is that I am literally stuck in implementing the any kind of ros_control for this board.
For now, I have tried 'faking' the data using diff_drive_controller, for example, my node that communicates with the custom board is listening to the cmd_vel topic and I have written simple logic for calling board maneuver-s. Something like this:
- If cmd_vel velocity x is 0.3 <-> 0.4 and angular rotation is < 0.10 - maneuver_forward
- If cmd_vel velocity x is < 0.3 and angular rotation is > 0.10 - maneuver_rotate
And similar, so basicly, I can control my robot using teleop_twist_keyboard and my logic, well, it kinda works for phisically controlling the robot.
Since now, I have been using Nav2 with Gazebo simulation and diff_drive_controller with my URDF robot model and I have configred the planning, obstacle avoidance, waypoint following, slam (lidar on robot) etc. etc. and now I need to actually move it to physical robot... and here is where I am stuck.
I have spent countles hours on going over documentations, searching for tutorials, etc. etc. and failed to find any clue on how should I proceed next.
I have also written custom /odom publisher for my physical rover which takes in Gyroscope, RPM values and I manually calculate rover position in x, y, z grid...
Now, here are my questions.
- Is it possible to use ROS2 and Nav2 with this kind of custom robot board?
- Would it be easier if the custom board was 'stupid' and offer ...