Comments (3)
你好,我的建议是直接新建一个FSM,在一个专门的FSM状态机里测试您的功能,您这样的写法相当于重写了一个main.cpp了,这是我们不推荐的。您可以参考State_SwingTest.cpp 和 State_SwingTest.h 新建一个类似的用于测试您上述功能的状态机。
from unitree_guide.
也就是说重新创建State_x.cpp和State_x.h,添加一个新的状态机模块,设置好启动该状态机的键位,再用jounir_ctrl打开自定义的状态机,这样理解正确吗?
from unitree_guide.
是的,这样做的好处是 您就可以把主要的精力放于想要实现的功能上了,先实现您的功能剩下的事情就好办了。你上述问题没有响应需要参考下
1.
while(running){
ctrlFrame.run();
}
2.
void FSM::run(){
_startTime = getSystemTime();
_ctrlComp->sendRecv();
_ctrlComp->runWaveGen();
_ctrlComp->estimator->run();
if(!checkSafty()){
_ctrlComp->ioInter->setPassive();
}
if(_mode == FSMMode::NORMAL){
_currentState->run();
_nextStateName = _currentState->checkChange();
if(_nextStateName != _currentState->_stateName){
_mode = FSMMode::CHANGE;
_nextState = getNextState(_nextStateName);
std::cout << "Switched from " << _currentState->_stateNameString
<< " to " << _nextState->_stateNameString << std::endl;
}
}
else if(_mode == FSMMode::CHANGE){
_currentState->exit();
_currentState = _nextState;
_currentState->enter();
_mode = FSMMode::NORMAL;
_currentState->run();
}
absoluteWait(_startTime, (long long)(_ctrlComp->dt * 1000000));
}
FSM Class 相当于一个状态机管理器,管理这FSM文件夹里的状态机。
from unitree_guide.
Related Issues (20)
- 底层控制时电机的力矩赋值 HOT 1
- 请问有没有关于gazebo可以运行在ros2上的教程 HOT 1
- How to publish odom
- catkin_make 编译时错误 HOT 10
- Wrong Assignment in State-Estimation HOT 1
- Some packages are missing
- ROS仿真中的问题
- B1 simulation controller fine tuning
- Could Go2 with Ros2 support gazebo?
- 交流群链接 HOT 1
- gazebo掉帧 HOT 7
- 能再发下交流群群号吗?亲~~ HOT 9
- SwingTest中torque未初始化的问题 HOT 4
- 找不到11.5.2节中unitree_pointCloud_publisher的程序包,有网址吗? HOT 5
- compatibility with go2 model HOT 6
- junior_ctrl文件在哪里 HOT 5
- 按4之后,狗子马上倒了?Why?Thank you HOT 2
- WaveStatus中的SWING_ALL有什么用?同时在State_Trotting.cpp文件中的exit()函数中,为什么要设置_ctrlComp->setAllSwing()? HOT 4
- 运行控制器junior_ctrl后按下<L2+A>正常,但按下<L2+Y>实体Go1会强烈抖动并重启,这是为什么? HOT 1
- Catkin_make报错 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unitree_guide.