Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1

Open
JTDeve opened this issue Nov 15, 2019 · 1 comment
Open

#1

JTDeve opened this issue Nov 15, 2019 · 1 comment

Comments

@JTDeve
Copy link

JTDeve commented Nov 15, 2019

讲的很通俗易懂,棒!
想请教一下ListLeg(void)函数中的if(Abs(body.vx) < 2 && Abs(body.vy) < 2 && Abs(body.rotate) < 2)是什么意思啊,body.vx和body.vy不知道具体是什么参数,那个,我能有幸加您QQ嘛(980902473)

@imuncle
Copy link
Owner

imuncle commented Mar 18, 2020

不好意思今天才看到你的问题。body.vx代表的是机器人在x方向的行走速度,body.vy同理。

可以在body_task.c里面看到以下代码:

if(body.workstate == Walk)
{
	body.vx = remote.value.right_y - 16;
	body.vy = remote.value.right_x - 16;
	body.rotate = remote.value.left_x - 16;
	ListLeg();
	Move(&FR_Leg);
	Move(&FL_Leg);
	Move(&BL_Leg);
	Move(&BR_Leg);
}

大意是当机器人是行走状态时,body.vx由遥控器的数据决定(遥控器的中值是16),但我的遥控器数值不稳定,这里是设置一个遥控器死区,防止出现静止时机器人乱动的情况。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants