Closed YANGGANG1971 closed 4 years ago
Thanks for reporting the bug @YANGGANG1971
This is a quite outdated tutorial that needs some upgrade regarding the setting up of the correct control mode prior to sending commands.
Hence, I'll be dealing with the upgrade and I'll get back to you once done.
PS: as a general remark, please open up issues within the repository containing the code that raised the bug/question... I've moved this issue here from YARP.
En passant, a quite complete tutorial on the use of different control modes can be found at https://github.com/vvv-school/tutorial_joint-interface.
@YANGGANG1971 it should be fixed now 👍
Sorry, I am still confusing. It seems that there is no change in the link below. http://www.icub.org/software_documentation/icub_basic_image_processing.html
Also, you said that needs some upgrade regarding the setting up of the correct control mode before sending commands. How to set up the correct control mode? The link below does not explain the detail. https://github.com/vvv-school/tutorial_joint-interface.
Sorry, I fixed only the code; https://github.com/robotology/icub-tutorials/commit/d6f4d4d0392e37c1765cde4487f0ca140ab05cc0 fixed the documentation too.
Anyway, you have to wait that our server will be triggered to update the documentation page.
I noted that only the snippet of codes below was added. but it seems that the syntax errors occurred.
vector<int> modes(jnts,VOCAB_CM_VELOCITY); mod->setControlModes(modes.data());
Maybe, the correct syntax is as follows,
Vector modes(jnts,VOCAB_CM_VELOCITY); mod->setControlModes((int*)modes.data());
Although I added the contents, it seems that the joints still cannot move.
@YANGGANG1971
For the code, you have to download it from the repository where the fix was already correct.
Peruse lookAtLocation.cpp
, then.
The documentation cannot be compiled 😉 hence I missed to include the following:
#include <vector>
Instead, the modifications you have suggested, that is
Vector modes(jnts,VOCAB_CM_VELOCITY);
mod->setControlModes((int*)modes.data());
doesn't turn right here as setControlModes()
does expect a vector of int and not double.
This might explain why the tutorial wasn't working yet, I think.
Following the link below, I try to control the head movement.
(http://www.icub.org/software_documentation/icub_basic_image_processing.html )
But some errors occurred. It may be due to velocityMove() function.
The codes are as follows.