Closed DermyO closed 8 years ago
Hi @misaki43
I've launched oneChainDynamics
and it runs smoothly providing this output
. I've tested it both in Windows and in Linux successfully.
Did you make sure that the tutorials are linking against the most recent version of icub-main
bundle on your machine?
Hi, No I didn't verify it, but I don't know how to check (?)
Someone told me after my post that iDyn
might not work anymore and that I should use iDynTree
: is anyone else better aware of it?
It should suffice checking the content of ICUB_DIR
cmake variable while cmaking the icub-tutorials
project.
As far as I know, iDyn
is still fully operative: indeed, it's being used by a bunch of our crucial modules (e.g. wholeBodyDynamics
).
However, iDynTree
does extend iDyn
providing a more comprehensive approach to robot dynamics.
Therefore, if your aim is to learn how to deal with robot dynamics, my warm suggestion is to start from iDynTree
straightaway.
I don't undertand but in the cmake variable I have "ICUB_DIR /usr/lib/ICUB", is that you want I check? But ok I will try iDynTree directly, thanks!
Then you're using an installed version of icub-main
.
This means that in the past you did one of the following:
sudo apt-get install icub
.make install
it (as root?).That tutorial should work fine even if the icub
installed version might be a bit old, since iDyn
hasn't changed recently. Anyway, you could consider going with the latest code of icub-main
, thus refer to case 2.
Locate the icub-main
sources on your drive and do git pull
and (sudo) make install
. It's important to make sure that the install
part is done, otherwise the libraries in /usr/lib
won't get updated. To verify that, you could inspect the date and the time of those products in /usr/lib
.
Unfortunately I'm not an expert of the super-build mechanism, hence I'd rather point you to @drdanz or @traversaro.
Hi! I have changed some other things that should resolve my previous problem (it is why I don't answer before) and I tried again to launch wholeBodyDynamics. Now, I have a new problem that appears during the "make":
61: error: invalid initialization of non-const reference of type ‘yarp::sig::Vector&’ from an rvalue of type ‘yarp::sig::Vector’ printVector("Joint Angles - real ", armTorsoDyn.getAng()); ^ /home/user/Software/src/icub-tutorials/src/iDyn/oneChainDynamics/main.cpp:37:6: error: in passing argument 2 of ‘void printVector(std::string, yarp::sig::Vector&)’ void printVector(string s, Vector &v) ^ make[2]: * [oneChainDynamics/CMakeFiles/oneChainDynamics.dir/main.cpp.o] Error 1 make[1]: * [oneChainDynamics/CMakeFiles/oneChainDynamics.dir/all] Error 2 make: *\ [all] Error 2"
This error wasn't there before, that is strange. Have you an idea?
Note: I read:
iDyn depends only on YARP and iKin. In order to include iDyn and use it in your software, make sure you include the following line in the CMakeLists.txt: TARGET_LINK_LIBRARIES(${PROJECTNAME} ... iDyn ...) Of course if you are developing outside the iCub project (e.g. in contrib), you may also add these lines: FIND_PACKAGE(YARP) FIND_PACKAGE(ICUB) In your code the iDyn namespace must be declared, and the header files needed must be included:
So I added in the CMakeLists.txt in the i"icub-tutorial/src/iDyn" folder the next lines:
TARGET_LINK_LIBRARIES(/home/user/Software/src/icub-tutorial/src/iDyn) FIND_PACKAGE(YARP) FIND_PACKAGE(ICUB)
Is it what I was supposed to do?
Sorry, I forgot to mention that in the meantime I've revived a couple of iDyn related tutorials in the icub-tutorials/src/iDyn
path, hence I had to streamline a bit the code and you ought to update icub-tutorials
as well.
Simply, make sure that you have the freshest icub-main
and icub-tutorials
on your machine; they should compile successfully. No need for tuning cmake files.
Ok thanks it is working now! This issue is resolved.
Happy new year
Great. Happy new year @misaki43
Hi, I tried to launch the oneChainDynamics function but I have a "Segmentation fault (core dumped)" error. By testing the code (main.cpp), I can see that the problem is localized when the arm is supposed to be created: "iCubArmDyn armTorsoDyn("right");". What I am doing wrong?