Loading files
e2444395dThis file is pinned to the selected release. Download the original to open it in your design tool.
/*
* File: leg_pos.c
*
* MATLAB Coder version : 5.5
* C/C++ source code generated on : 27-Jan-2023 19:41:46
*/
/* Include Files */
#include "leg_pos.h"
#include <math.h>
/* Function Definitions */
/*
* LEG_POS
* POS = LEG_POS(PHI1,PHI4)
*
* Arguments : float phi1
* float phi4
* float pos[2]
* Return Type : void
*/
void leg_pos(float phi1, float phi4, float pos[2])
{
float a;
float b_a;
float t14;
float t15;
float t2;
float t3;
float t4;
float t5;
float t6;
float t8_tmp;
/* This function was generated by the Symbolic Math Toolbox version 9.2.
*/
/* 27-Jan-2023 19:36:58 */
t2 = cosf(phi1);
t3 = cosf(phi4);
t4 = sinf(phi1);
t5 = sinf(phi4);
t6 = t2 / 20.0F;
t8_tmp = t4 / 20.0F;
t14 = t4 * 0.0105F;
t15 = t5 * 0.0105F;
t5 = t8_tmp - t5 / 20.0F;
a = (t3 / 20.0F - t6) + 0.06F;
b_a = t14 - t15;
t4 = t3 * 0.0105F - t2 * 0.0105F;
t5 = t5 * t5 + a * a;
t4 = atanf(1.0F / ((t4 + 0.0126F) + t5) *
((t15 - t14) +
sqrtf((b_a * b_a + (t4 + 0.0126F) * (t4 + 0.0126F)) - t5 * t5))) *
2.0F;
t5 = t8_tmp + sinf(t4) * 0.105F;
t4 = (t6 + cosf(t4) * 0.105F) - 0.03F;
pos[0] = sqrtf(t5 * t5 + t4 * t4);
pos[1] = atan2f(t5, t4);
}
/*
* File trailer for leg_pos.c
*
* [EOF]
*/