Arduino control one turn

Hello everyone,
I am trying to make a turn. I am using Arduino for control. First I read the motor position and then make the turn. If the number returned by odrive.Getposition is less than 1 it works fine but if it is greater than 1 it does not work. I have seen people use the cos function to make the number between 0 and 1, but the problem with that is that it makes a jump from the initial position to the cos position. Any ideas to solve the problem?
If you need more information let me know.

Thanks in advance

// Sinusoidal test move
if (c == 's') {
  Serial.println("Executing test move");

  float pos_motor;
  float pos_motor_ini;
  pos_motor = odrive.GetPosition(0);
  pos_motor_inicial = odrive.GetPosition(0);
  Serial.println(pos_motor);

  for ( pos_motor; pos_motor < 1.0f + pos_motor_inicial; pos_motor += 0.005f) {
    float pos_m0 =  cos(pos_motor);
    Serial.print(pos_motor);
    Serial.print("--");
    Serial.print(pos_m0);
    Serial.println("*******");
    odrive.SetPosition(pos_motor_ini, pos_m0);

    delay(5);
  }

}

The snippet of code you presented has a lot of issues. Hence it is hard to answer your question exactly. However, I think most of the confusion originates from

odrive.SetPosition(pos_motor_ini, pos_m0);

The first argument to SetPosition is the axis (motor) number. It is the same as for GetPosition, and you explicitly use axis (motor) 0 there. However here you use pos_motor_ini as the first argument and it is not even initialized in your snippet.

Thanks for the reply.
I have change the line

odrive.SetPosition(0, pos_motor);

and now seems to work fine.