darwinop / webots-cross-compilation

porting behavioral settings from a webots darwin onto a real darwin
www.robotsource.org
5 stars 9 forks source link

Compile the wrapper library Error #131

Closed ghost closed 11 years ago

ghost commented 11 years ago

Hi everyone, i have a problem while compiling the wrapper library. The errors are show as follows. Please help me :+1:
Thanks

root@darwin:/darwin/Linux/project/webots/transfer/lib# make g++ -c -O2 -DLINUX -Wall -I/darwin/Linux/include -I/darwin/Framework/include -I../include -I../keyboard -c -o ../src/Robot.o ../src/Robot.cpp ../src/Robot.cpp: In constructor ‘webots::Robot::Robot()’: ../src/Robot.cpp:30: error: ‘class Robot::CM730’ has no member named ‘MakeBulkReadPacketWb’ ../src/Robot.cpp: In member function ‘void webots::Robot::LoadINISettings(minIni, const std::string&)’: ../src/Robot.cpp:321: error: assignment of read-only variable ‘Robot::Camera::WIDTH’ ../src/Robot.cpp:326: error: assignment of read-only variable ‘Robot::Camera::HEIGHT’ ../src/Robot.cpp:332: error: assignment of read-only variable ‘Robot::Camera::WIDTH’ ../src/Robot.cpp:333: error: assignment of read-only variable ‘Robot::Camera::HEIGHT’ make: ** [../src/Robot.o] Error 1

DavidMansolino commented 11 years ago

Hi euclid1990,

Did you do step E0 :

 On the DARwIn-OP, merge $GIT_REPOSITORY/resources/projects/robots/darwin-op/darwin/ with existing DARwIn-OP source code in /darwin/ directory

 $ cp -R $GIT_REPOSITORY/resources/projects/robots/darwin-op/darwin/* /darwin/ 

David

ghost commented 11 years ago

I try do step E0 : but it has error:

cp: cannot stat `/resources/projects/robots/darwin-op/darwin/*': No such file or directory

So, I downloaded webots-cross-compilation-master.zip, and copy all file in resources/projects/robots/darwin-op/darwin , then paste it into my /darwin directory on Robot

ghost commented 11 years ago

Thank you, I have fix all error to compile library.

But now i have a problem when run [Linux/project/demo] program:

root@darwin:/darwin/Linux/project/demo# ./demo Playing MPEG stream from "../../../Data/mp3/Demonstration ready mode.mp3" ... exec failed!!

What should I do to fix these problems? ?

DavidMansolino commented 11 years ago

HI, good news that you fix this error, Can you tell me where was the problem?

The program 'demo' is independent from this project. But maybe try to recompile this program and retest it. Do you hear the sound before that it stop (check that sound is on before) ?

ghost commented 11 years ago

i dont hear any sound before that it stop. Now, i try to write a program that include library

include "Controller.hpp"

include < webots/Servo.hpp >

include < webots/LED.hpp >

include < webots/Camera.hpp >

include < webots/Accelerometer.hpp >

include < managers/DARwInOPMotionManager.hpp >

include < managers/DARwInOPGaitManager.hpp >

include < JointData.h >

include "LinuxDARwIn.h"

--------------------------- ERROR --------------------------

/darwin/Linux/project/webots/src/managers/DARwInOPMotionManager.o: In function managers::DARwInOPMotionManager::DARwInOPMotionManager(webots::Robot*)': DARwInOPMotionManager.cpp:(.text+0x69d): undefined reference tomanagers::DARwInOPMotionTimerManager::MotionTimerInit()' /darwin/Linux/project/webots/src/managers/DARwInOPMotionManager.o: In function managers::DARwInOPMotionManager::DARwInOPMotionManager(webots::Robot*)': DARwInOPMotionManager.cpp:(.text+0xafd): undefined reference tomanagers::DARwInOPMotionTimerManager::MotionTimerInit()' /darwin/Linux/project/webots/src/managers/DARwInOPGaitManager.o: In function managers::DARwInOPGaitManager::DARwInOPGaitManager(webots::Robot*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': DARwInOPGaitManager.cpp:(.text+0x763): undefined reference tomanagers::DARwInOPMotionTimerManager::MotionTimerInit()' /darwin/Linux/project/webots/src/managers/DARwInOPGaitManager.o: In function managers::DARwInOPGaitManager::DARwInOPGaitManager(webots::Robot*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)': DARwInOPGaitManager.cpp:(.text+0x973): undefined reference tomanagers::DARwInOPMotionTimerManager::MotionTimerInit()' /darwin/Linux/project/webots/transfer/lib/wrapper.a(Robot.o): In function webots::Robot::keyboardDisable()': Robot.cpp:(.text+0xb6): undefined reference toKeyboard::closeWindow()' Robot.cpp:(.text+0xc1): undefined reference to Keyboard::resetKeyPressed()' /darwin/Linux/project/webots/transfer/lib/wrapper.a(Robot.o): In functionwebots::Robot::KeyboardTimerProc(void)': Robot.cpp:(.text+0x110): undefined reference to Keyboard::startListenKeyboard()' /darwin/Linux/project/webots/transfer/lib/wrapper.a(Robot.o): In functionwebots::Robot::keyboardEnable(int)': Robot.cpp:(.text+0x147): undefined reference to Keyboard::createWindow()' /darwin/Linux/project/webots/transfer/lib/wrapper.a(Robot.o): In functionwebots::Robot::step(int)': Robot.cpp:(.text+0x3dbf): undefined reference to Keyboard::resetKeyPressed()' /darwin/Linux/project/webots/transfer/lib/wrapper.a(Robot.o): In functionwebots::Robot::Robot()': Robot.cpp:(.text+0x3fcd): undefined reference to Keyboard::Keyboard()' /darwin/Linux/project/webots/transfer/lib/wrapper.a(Robot.o): In functionwebots::Robot::Robot()': Robot.cpp:(.text+0x448d): undefined reference to Keyboard::Keyboard()' /darwin/Linux/project/webots/transfer/lib/wrapper.a(Robot.o): In functionwebots::Robot::keyboardGetKey()': Robot.cpp:(.text+0x70): undefined reference to `Keyboard::getKeyPressed()' collect2: ld returned 1 exit status make: ** [imitation] Error 1

DavidMansolino commented 11 years ago

Have you try the example coming with 'webots-cross-compilation' ? They must be in /darwin/Linux/project/webots/controllers/ If yes, did they work ?

ghost commented 11 years ago

I have try [webots-cross-compilation/projects/robots/darwin-op/controllers/soccer]

root@darwin:/darwin/Linux/project/webots/controllers/soccer# make -f Makefile.darwin-op g++ -O2 -DLINUX -DCROSSCOMPILATION -Wall -I/darwin/Linux/include -I/darwin/Framework/include -I/darwin/Linux/project/webots/transfer/include -I/darwin/Linux/project/webots/include -c -o main.o main.cpp g++ -O2 -DLINUX -DCROSSCOMPILATION -Wall -I/darwin/Linux/include -I/darwin/Framework/include -I/darwin/Linux/project/webots/transfer/include -I/darwin/Linux/project/webots/include -c -o Soccer.o Soccer.cpp g++ -lpthread -ljpeg -lrt main.o Soccer.o /darwin/Linux/project/webots/src/managers/DARwInOPDirectoryManager.o /darwin/Linux/project/webots/src/managers/DARwInOPMotionManager.o /darwin/Linux/project/webots/src/managers/DARwInOPMotionTimerManager.o /darwin/Linux/project/webots/src/managers/DARwInOPGaitManager.o /darwin/Linux/project/webots/src/managers/DARwInOPVisionManager.o /darwin/Linux/project/webots/transfer/lib/wrapper.a /darwin/Linux/project/webots/transfer/keyboard/keyboard.a /usr/lib/libX11.so.6 /darwin/Linux/lib/darwin.a -o soccer chmod 755 soccer

root@darwin:/darwin/Linux/project/webots/controllers/soccer# ./soccer Fail to connect CM-730!

But when run it, has error shown as above !

ghost commented 11 years ago

DavidMansolino, thank you very much for your support, i have found the cause of the error when compile, it exist in Makefile.darwin-op. And i edit it.

But when run program, it has error ? and i dont know why ?

Fail to connect CM-730!

DavidMansolino commented 11 years ago

It seems that another program is already communicating with the CM-730 card. I think it is the demo program, try 'sudo killall demo' Did it resolve your problem?

The example soccer been a complex example I recommend you to start by another simpler example (example symmetry is very basic for example).

ghost commented 11 years ago

Thank you, after kill proccess of demo, I can run my program :+1: I am building a system that Full-Body Imitation of Human Motions with Kinect and Darwin-OP I have tested it on simulation, The rest is just running on the real robot I will update my code, look forward to receiving help from you.

DavidMansolino commented 11 years ago

Good news that it works. Your project seems very interesting, Did you use Webots or an other simulator to run your simulation? Good luck for the end of your project. David

ghost commented 11 years ago

I used Webots for simulator, and Microsoft Kinect for Motion Capture. Thank you Nguyen Van Vuong

DavidMansolino commented 11 years ago

You are Welcome

ghost commented 11 years ago

Sorry, i have a question. When i run example [symmetry], why it can run but it has error [Segmentation fault]. Have you ever faced the problem ?


root@darwin:/darwin/Linux/project/webots/controllers/symmetry# ./symmetry -------Symmetry example of DARwIn-OP------- The right arm is free while the left one mimic it. In order to move the left arm, select the robot with the mouse, press ctr+alt and select the right arm. Now you just have to move the mouse without releasing it. This example illustrate also the selfCollision which is activated by default Segmentation fault

DavidMansolino commented 11 years ago

No I have never faced this problem with this example, Try to clean and recompile this example. If the problem still exist, try tu use gdb:

 Recompile the controller with the flag -g (to add in the makefile.darwin-op)
 type 'gdb ./symmetry'
 type 'run'
 when the controller crash type 'where'
ghost commented 11 years ago

I have used gdb, In order to move the left arm, select the robot with the mouse >>> What does this mean ?

------------------------------- Re Compile---------------------------------- root@darwin:/darwin/Linux/project/webots/controllers/symmetry# make -f Makefile.darwin-op g++ -lpthread -ljpeg -lrt main.o Symmetry.o /darwin/Linux/project/webots/transfer/lib/wrapper.a /darwin/Linux/project/webots/transfer/keyboard/keyboard.a /usr/lib/libX11.so.6 /darwin/Linux/lib/darwin.a -o symmetry chmod 755 symmetry root@darwin:/darwin/Linux/project/webots/controllers/symmetry# make -f Makefile.darwin-op g++ -g -O2 -DLINUX -DCROSSCOMPILATION -Wall -I/darwin/Linux/include -I/darwin/Framework/include -I/darwin/Linux/project/webots/transfer/include -I/darwin/Linux/project/webots/include -c -o main.o main.cpp g++ -g -O2 -DLINUX -DCROSSCOMPILATION -Wall -I/darwin/Linux/include -I/darwin/Framework/include -I/darwin/Linux/project/webots/transfer/include -I/darwin/Linux/project/webots/include -c -o Symmetry.o Symmetry.cpp g++ -lpthread -ljpeg -lrt main.o Symmetry.o /darwin/Linux/project/webots/transfer/lib/wrapper.a /darwin/Linux/project/webots/transfer/keyboard/keyboard.a /usr/lib/libX11.so.6 /darwin/Linux/lib/darwin.a -o symmetry chmod 755 symmetry

------------------------------- GDB ---------------------------------- root@darwin:/darwin/Linux/project/webots/controllers/symmetry# gdb ./symmetry GNU gdb (GDB) 7.0-ubuntu Copyright (C) 2009 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "i486-linux-gnu". For bug reporting instructions, please see: http://www.gnu.org/software/gdb/bugs/... Reading symbols from /darwin/Linux/project/webots/controllers/symmetry/symmetry...done. (gdb) run Starting program: /darwin/Linux/project/webots/controllers/symmetry/symmetry [Thread debugging using libthread_db enabled] -------Symmetry example of DARwIn-OP------- The right arm is free while the left one mimic it. In order to move the left arm, select the robot with the mouse, press ctr+alt and select the right arm. Now you just have to move the mouse without releasing it. This example illustrate also the selfCollision which is activated by default

Program received signal SIGSEGV, Segmentation fault. 0x08050769 in webots::Servo::setPresentPosition(int) () (gdb) where

0 0x08050769 in webots::Servo::setPresentPosition(int) ()

1 0x0804eee3 in webots::Robot::step(int) ()

2 0x0804abc8 in webots::Symmetry::myStep (this=0x806a998) at Symmetry.cpp:45

3 0x0804b39e in webots::Symmetry::run (this=0x806a998) at Symmetry.cpp:91

4 0x0804ab48 in main (argc=1, argv=0xbffff764) at main.cpp:15

ghost commented 11 years ago

when i try run the code as following:

void Sample::run() { while (true) { mServos[0]->setPosition(0.0);
// step myStep(); } }


The video: https://www.youtube.com/watch?v=5Y4vm96cYPE

DavidMansolino commented 11 years ago

In order to move the left arm, select the robot with the mouse

This for moving the free arm in simulation, when running the controller on the real robot you can simply move it manually.

The vibrations that you have in your videos are very strange, did you activate the gait or motion manager before? If you try example [visual_tracking], did you have similar behaviour?

I will investigate about your segmentation fault.

ghost commented 11 years ago

Before, i only run my program, it has the code


include < managers/DARwInOPMotionManager.hpp >

include < managers/DARwInOPGaitManager.hpp >

. . . Controller::Controller():Robot(){

mTimeStep = getBasicTimeStep();

mEyeLED = getLED("EyeLed"); mHeadLED = getLED("HeadLed"); mHeadLED->set(0x10C040); mCamera = getCamera("Camera"); mCamera->enable(mTimeStep);

mAccelerometer = getAccelerometer("Accelerometer"); mAccelerometer->enable(mTimeStep);

for (int i=0; i < NSERVOS ; i++ ) { mServos[i] = getServo(servoNames[i]); mServos[i]->enablePosition(1); } mMotionManager = new DARwInOPMotionManager(this); mGaitManager = new DARwInOPGaitManager(this, "config.ini");

jointData = new ::Robot::JointData(); } . . .

.

When I try example [visual_tracking], the head of Darwin-op have similar behaviour :(

DavidMansolino commented 11 years ago

Why did you add this line :

jointData = new ::Robot::JointData();

I think this line cause the vibrations, can you try without?

ghost commented 11 years ago

I am tried the simple code, but it still has a problem. Plz wait, i will upload my project :dart:

void Sample::run() { while (true) { mServos[0]->setPosition(0.0);

// step myStep(); } }

vmatos commented 11 years ago

Sorry to meddle. I'm not completely following the discussion, but just saw the video. What values are you using for the servo's PID parameters? Sometimes, high values of P value will make your servos vibrate.

ghost commented 11 years ago

My code: http://www.mediafire.com/?0xdtx3l5g10jydt After download it, extract and copy [imitation] folder & paste it into webots/controller

DavidMansolino commented 11 years ago

Hi vmatos you are welcome if you have any idea. Thank for your code I will test it.

ghost commented 11 years ago

@vmatos : I am only work and programing robot on webots simulation, it is the first time i can run my anything i wrote on real robot. And i have many problems :) You can see my code, its very simple, but with me it have some troubles :(

DavidMansolino commented 11 years ago

I have tested you controller, everything seems fine, I have just commented this two lines

//#include "JointData.h" these two lines are not needed //#include "LinuxDARwIn.h"

And it work fine on my darwin : http://dl.dropbox.com/u/16722593/MOV026.3gp (sorry for the bad quality)

vmatos is right, a high value of P can make it unstable and therefore causes vibrations.

Maybe your default values are not good, you can try to check them with this tool : http://support.robotis.com/ko/e-manual_kor.htm#product/darwin-op/development/tools/dynamixel_monitor.htm

ghost commented 11 years ago

What is the P value ? where i can edit the default value ? Thank you

DavidMansolino commented 11 years ago

With this tool you can check what default value you have for P : http://support.robotis.com/ko/e-manual_kor.htm#product/darwin-op/development/tools/dynamixel_monitor.htm start it (already instal on the robot in the folder /darwin/Linux/project/dxl_monitor), then type 'id 1', and then type 'd',

Then please let us know what you have for P_GAIN, I_GAIN and D_GAIN (you should have something similar to this : http://support.robotis.com/ko/images/product/darwin-op/image130.jpg)

ghost commented 11 years ago

This is my Darwin : Right Shoulder Pitch (ID-1). Has it got a problem ?

Dynamixel Monitor http://farm9.staticflickr.com/8503/8387338552_b265a2bbae_z.jpg

Offset Turner http://farm9.staticflickr.com/8358/8386296509_23875f8855_z.jpg

Walk Turner http://farm9.staticflickr.com/8359/8387399886_6db9aa9bd4_z.jpg

DavidMansolino commented 11 years ago

Yes it seems their is a problem, your D_GAIN is 8 and your P_GAIN is 0, i think it must be the contrary. Can you make the test (only Dynamixel Monitor) on another servo (another ID) ? I will check this tomorrow morning.

ghost commented 11 years ago

Ok, i also test it and post the result on tomorrow, I live in Japan and now is 3h AM.

ghost commented 11 years ago

Hi everyone, today i have test another ID: example ID-2. But the left arm still vibrated :(

(ID-2) Dynamixel Monitor http://farm9.staticflickr.com/8097/8388145993_f32e77bdd8_z.jpg

DavidMansolino commented 11 years ago

Hi, here again your values for the GAIN are strange, Furthermore your firmware of the servo seems to not be up to date (version = 27 which is an old one) maybe start be updating them by using this tool : http://support.robotis.com/ko/e-manual_kor.htm#product/darwin-op/development/tools/firmware_installer.htm

ghost commented 11 years ago

In my firmware_installer folder has 3 files:

@DavidMansolino: What file should I choose ? ./firmware_installer -c cm730_0x13.hex -a [??????????].hex

DavidMansolino commented 11 years ago

You have to chose mx28_0x1E+FSR_0x11.hex The other one is an old one (with a bad angular resolution)

ghost commented 11 years ago

@DavidMansolino :100: Done. And My Robot can perform any input motion. Thank you

DavidMansolino commented 11 years ago

Very good news! You are welcome

gnaeshniranjan commented 7 years ago

Hello everyone , i have a problem in runing the demo program in darwin op when i run it , it is saying that : Cannot identify '/dev/vedio0': 2, No such file or directory please help me out with it

it would mean lot

thank you

DavidMansolino commented 7 years ago

Dear gnaeshniranjan,

Are you trying to start a Webots controller on the robot or are you simply trying to start the demo program comming by default with the darwin-op?

Best, David

gnaeshniranjan commented 7 years ago

i was just trying to start the demo program ; it was not working then then i tried Clonezilla recovery then it is not fully recovered but the saved the extra files in Darwin op now the program is working fine but some times it is not responding well

DavidMansolino commented 7 years ago

Dear gnaeshniranjan,

Good news that you managed to make the program working fine. However this repository is about using Webots controller/API on the Darwin-op, if you have problem with the demo program coming with the darwin-op you should contact directly Robotis (http://www.robotsource.org/bs/bd.php?bt=forum_Darwin).

Sincerely, David

gnaeshniranjan commented 7 years ago

Thank you very much ................ :)

On Fri, May 5, 2017 at 12:13 PM, David Mansolino notifications@github.com wrote:

Dear gnaeshniranjan,

Good news that you managed to make the program working fine. However this repository is about using Webots controller/API on the Darwin-op, if you have problem with the demo program coming with the darwin-op you should contact directly Robotis (http://www.robotsource.org/ bs/bd.php?bt=forum_Darwin).

Sincerely, David

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/darwinop/webots-cross-compilation/issues/131#issuecomment-299394089, or mute the thread https://github.com/notifications/unsubscribe-auth/AbCHuEUKAFRPEv7Qxv-f3ORErcz28Cykks5r2sUAgaJpZM4AXUws .

--


Disclaimer: This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited.