足回り用プログラム(修正版)
Dependencies: SBDBT arrc_mbed BNO055
TARGETco.cpp
- Committer:
- kazumayamanaka
- Date:
- 2022-01-28
- Revision:
- 5:e189d55ef292
- Parent:
- 1:ea880e226e5a
File content as of revision 5:e189d55ef292:
#include "TARGETco.hpp" void TARGETco::pass_val(double XPOWER,double YPOWER,double THETA){ Xpower = XPOWER; Ypower = YPOWER; theta = THETA; cal_angular(); } void TARGETco::pass_target(double TARGET){ for(int i = 0;i < 4;i ++){ target[i] = TARGET; } } void TARGETco::cal_angular(){ Xvelocity = Xpower * cos(theta) - Ypower * sin(theta); Yvelocity = -Xpower * sin(theta) - Ypower * cos(theta); target[0] = -Xvelocity; target[1] = -Yvelocity; target[2] = Xvelocity; target[3] = Yvelocity; } double TARGETco::obt_target1(){ return target[0]; } double TARGETco::obt_target2(){ return target[1]; } double TARGETco::obt_target3(){ return target[2]; } double TARGETco::obt_target4(){ return target[3]; }