Open eastskykang opened 3 years ago
Thanks for the instructions!
I managed to make the robot walk on uneven terrain. However thes "lines" have still the old height. Does this influence the points negatively?
Edit: From #28 I guess only "walking on uneven ground" is needed, so these lines don't matter.
@iqiac this is fine. Looks great. Awesome job :)
Please just try to make the demo video visible enough so that we can clearly see the robot walks on the uneven terrain.
When I tried to call SimpleGroundModel terrain
in files in simAndControl, I go this error:
/home/kevin/ETHz/CMM/a2-kevinhangoat/src/libs/simAndControl/kinematics/IK_Solver.h:31:9: error: ‘SimpleGroundModel’ was not declared in this scope SimpleGroundModel terrain;
Does this mean I need to change cmake file? Or I am supposed to do something different?
@kevinhangoat You don't need to change anything from cmake side for this exercise.
FYI. You should not use SimpleGroundModel for a mesh terrain. SimpleGroundModel is a flat ground. Please use hints I wrote above.
@kevinhangoat You don't need to change anything from cmake side for this exercise.
FYI. You should not use SimpleGroundModel for a mesh terrain. SimpleGroundModel is a flat ground. Please use hints I wrote above.
Thanks! But still I do not understand why I cannot call class Model in files like IK_Solver. So I am not supposed to go down that track?
@kevinhangoat Did you add
#include <gui/model.h>
to IK_Sover.h?
@eastskykang Yes, I did. The full error is:
/home/kevin/ETHz/CMM/a2-kevinhangoat/src/libs/simAndControl/kinematics/IK_Solver.h: In member function ‘void crl::IK_Solver::addEndEffectorTarget(crl::RB*, crl::P3D, crl::P3D)’:
/home/kevin/ETHz/CMM/a2-kevinhangoat/src/libs/simAndControl/kinematics/IK_Solver.h:31:9: error: ‘Model’ was not declared in this scope
Model terrain = Model(CRL_DATA_FOLDER "/terrain/terrain.obj");
^~~~~
/home/kevin/ETHz/CMM/a2-kevinhangoat/src/libs/simAndControl/kinematics/IK_Solver.h:31:9: note: suggested alternative:
In file included from /home/kevin/ETHz/CMM/a2-kevinhangoat/src/libs/gui/include/gui/renderer.h:6:0,
from /home/kevin/ETHz/CMM/a2-kevinhangoat/src/app/app.h:6,
from /home/kevin/ETHz/CMM/a2-kevinhangoat/src/app/main.cpp:3:
/home/kevin/ETHz/CMM/a2-kevinhangoat/src/libs/gui/include/gui/model.h:10:7: note: ‘crl::gui::Model’
class Model {
^~~~~
src/app/CMakeFiles/locomotion.dir/build.make:81: recipe for target 'src/app/CMakeFiles/locomotion.dir/main.cpp.o' failed
make[2]: *** [src/app/CMakeFiles/locomotion.dir/main.cpp.o] Error 1
CMakeFiles/Makefile2:687: recipe for target 'src/app/CMakeFiles/locomotion.dir/all' failed
make[1]: *** [src/app/CMakeFiles/locomotion.dir/all] Error 2
Makefile:159: recipe for target 'all' failed
make: *** [all] Error 2
please try gui::Model
instead of Model
@eastskykang Thank you so much, it works! I still have one problem that FPS is quite low, although I am already in release mode. What could be the problem?
@kevinhangoat does FPS drops when you play the app (by pressing space bar)? or is it already low as soon as you launch the app? Please see related issue #32
@eastskykang It drops when it starts playing. It happens if I load the mesh terrain and start playing (without any other change). Maybe my linux system is just slow?
Oh... it's possible. Mesh rendering is a bit heavy computation.
Maybe you are loading the terrain inside a loop? That was what caused most FPS drops for me.
If you are already done with all exercises (and also bored), please try to implement exercise 5 for a more complex terrain loaded from a mesh file. If you manage to successfully implement this, you will get extra 5% point (but your final point cannot exceed 100%)
This could be pretty complicated and may require a lot of code modifications. So please create a new branch called
meshterrain
and work there while keep your successful implementation of Ex.1~Ex.5 on the master (or main) branch. Again, please make sure your implementation of Ex.1 ~ Ex.5 stays safe in master (or main) branch. It's your responsibility to keep the main branch clean and working.Successful implementation will looks like this:
Click this for demo video
You can download a terrain file you want to use from any internet source, but if it's hard to find one, you can use one in data directory
data/terrain/terrain.obj
Note. You may need to read the code base thouroughly and spend quite some time.
Let me give some hints:
the strategy is as follows. From underground e.g. (x, -1.0, z), we will shoot a ray toward the sky (straight up) and then will find a
hitPoint
. ThehitPoint.y
is the ground height at (x, z) coordinate.