As we've said before, in order to make programming complicated behaviors easier, we're moving all but the PWM control code to a Raspberry Pi. This has the added benefit of saving us the trouble of generating lookup tables for every behavior in MATLAB.
Rocco gave us a crash course in making devices communicate using ROS topics. The Raspberry Pi will be generating an array of 18 servo angles every timestep and publishing it to a ROS topic. The Arduino will be checking that topic for the latest numbers and converting them to PWM output for the servos.
To generate the angles, the Raspberry Pi will be referencing a simpler lookup table. It consists of a list of the x, y, and z positions of the foot relative to the body servo of one of the legs at every timestep. That step can then be shifted in space to represent the position of each foot, and indexed to find the desired position at any given timestep.
From there, the Pi uses the reverse-kinematic trigonometric equations we derived to determine the angles of each servo. Since we have more experience with Python coding, we are able to use classes and functions across multiple files, and take advantage of ROS's real-time capabilities.
Rocco gave us a crash course in making devices communicate using ROS topics. The Raspberry Pi will be generating an array of 18 servo angles every timestep and publishing it to a ROS topic. The Arduino will be checking that topic for the latest numbers and converting them to PWM output for the servos.
To generate the angles, the Raspberry Pi will be referencing a simpler lookup table. It consists of a list of the x, y, and z positions of the foot relative to the body servo of one of the legs at every timestep. That step can then be shifted in space to represent the position of each foot, and indexed to find the desired position at any given timestep.
From there, the Pi uses the reverse-kinematic trigonometric equations we derived to determine the angles of each servo. Since we have more experience with Python coding, we are able to use classes and functions across multiple files, and take advantage of ROS's real-time capabilities.