poftwaresatent / stanford_wbc

Whole-Body Control framework developed at the Stanford Robotics and AI Lab
http://sourceforge.net/projects/stanford-wbc/
25 stars 8 forks source link

ambiguous reference to "Window" in tutsim.cpp #4

Closed jackhall closed 12 years ago

jackhall commented 12 years ago

stanford_wbc fails to build on Fedora Linux. A Window class is defined in tutsim.cpp, but X11 already has a typedef by the same name in X.h. I compiled with:

Fedora 16 on x86_64 gcc 4.6.2 cmake 2.8.7 boost 1.47.0 fltk 1.3.0 gtest 1.5.0

These are all up-to-date for this distro. The failed part of the build gave me:

[ 86%] Building CXX object tutorials/CMakeFiles/tut.dir/tutsim.cpp.o cd /home/jack/Code/stanford_wbc/build/tutorials && /usr/bin/c++ -DLINUX -DTIXML_USE_STL -DHAVE_GTEST -DTUTROB_XML_PATH_STR=\"/home/jack/Code/stanford_wbc/tutorials/tutrob.xml\" -g -I/usr/include/eigen2 -I/home/jack/Code/stanford_wbc/tutorials/../jspace -I/home/jack/Code/stanford_wbc/tutorials/../tao -I/home/jack/Code/stanford_wbc/tutorials/../opspace/include -pipe -Wall -O0 -o CMakeFiles/tut.dir/tutsim.cpp.o -c /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp: In member function ‘void {anonymous}::Simulator::tick()’: /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:313:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] /home/jack/Code/stanfordwbc/tutorials/tutsim.cpp: In static member function ‘static int tutsim::run(bool ()(size_t, double, double, jspace::State&, jspace::Vector&))’: /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:544:3: error: reference to ‘Window’ is ambiguous /usr/include/X11/X.h:96:13: error: candidates are: typedef XID Window /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:90:9: error: class {anonymous}::Window /home/jack/Code/stanfordwbc/tutorials/tutsim.cpp:544:10: error: expected ‘;’ before ‘win’ make[2]: ** [tutorials/CMakeFiles/tut.dir/tutsim.cpp.o] Error 1 make[2]: Leaving directory /home/jack/Code/stanford_wbc/build' make[1]: *** [tutorials/CMakeFiles/tut.dir/all] Error 2 make[1]: Leaving directory/home/jack/Code/stanford_wbc/build' make: *\ [all] Error 2

poftwaresatent commented 12 years ago

Jack,

Ah, yes that could indeed have been done more properly. The trouble is the Window class name in the anonymous namespace, I thought C++ resolved symbols there first but maybe not. I just pushed a fix, can you let me know if it works for you?

Cheers, Roland

On 2/25/12 6:25 AM, Jack Hall wrote:

stanford_wbc fails to build on Fedora Linux. A Window class is defined in tutsim.cpp, but X11 already has a typedef by the same name in X.h. I compiled with:

Fedora 16 on x86_64 gcc 4.6.2 cmake 2.8.7 boost 1.47.0 fltk 1.3.0 gtest 1.5.0

These are all up-to-date for this distro. The failed part of the build gave me:

[ 86%] Building CXX object tutorials/CMakeFiles/tut.dir/tutsim.cpp.o cd /home/jack/Code/stanford_wbc/build/tutorials && /usr/bin/c++ -DLINUX -DTIXML_USE_STL -DHAVE_GTEST -DTUTROB_XML_PATH_STR=\"/home/jack/Code/stanford_wbc/tutorials/tutrob.xml\" -g -I/usr/include/eigen2 -I/home/jack/Code/stanford_wbc/tutorials/../jspace -I/home/jack/Code/stanford_wbc/tutorials/../tao -I/home/jack/Code/stanford_wbc/tutorials/../opspace/include -pipe -Wall -O0 -o CMakeFiles/tut.dir/tutsim.cpp.o -c /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp: In member function ‘void {anonymous}::Simulator::tick()’: /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:313:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] /home/jack/Code/stanfordwbc/tutorials/tutsim.cpp: In static member function ‘static int tutsim::run(bool ()(size_t, double, double, jspace::State&, jspace::Vector&))’: /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:544:3: error: reference to ‘Window’ is ambiguous /usr/include/X11/X.h:96:13: error: candidates are: typedef XID Window /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:90:9: error: class {anonymous}::Window /home/jack/Code/stanfordwbc/tutorials/tutsim.cpp:544:10: error: expected ‘;’ before ‘win’ make[2]: ** [tutorials/CMakeFiles/tut.dir/tutsim.cpp.o] Error 1 make[2]: Leaving directory /home/jack/Code/stanford_wbc/build' make[1]: *** [tutorials/CMakeFiles/tut.dir/all] Error 2 make[1]: Leaving directory/home/jack/Code/stanford_wbc/build' make: *\ [all] Error 2


Reply to this email directly or view it on GitHub: https://github.com/poftwaresatent/stanford_wbc/issues/4

Dr. Roland Philippsen Assistant Professor, Halmstad University Kristian IV:x väg 3, 302 50 Halmstad, Sweden office: E527 telephone: +46 (0) 35 167 249 http://hh.se/

jackhall commented 12 years ago

Roland,

The compile still fails, but with a stranger error this time. The syntax you used when creating/initializing the Window object seems a little weird, but I haven't ever used anonymous namespaces...

[ 86%] Building CXX object tutorials/CMakeFiles/tut.dir/tutsim.cpp.o cd /home/jack/Code/stanford_wbc/build/tutorials && /usr/bin/c++ -DLINUX -DTIXML_USE_STL -DHAVE_GTEST -DTUTROB_XML_PATH_STR=\"/home/jack/Code/stanford_wbc/tutorials/tutrob.xml\" -g -I/usr/include/eigen2 -I/home/jack/Code/stanford_wbc/tutorials/../jspace -I/home/jack/Code/stanford_wbc/tutorials/../tao -I/home/jack/Code/stanford_wbc/tutorials/../opspace/include -pipe -Wall -O0 -o CMakeFiles/tut.dir/tutsim.cpp.o -c /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp: In member function void {anonymous}::Simulator::tick(): /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:313:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] /home/jack/Code/stanfordwbc/tutorials/tutsim.cpp: In static member function static int tutsim::run(bool ()(size_t, double, double, jspace::State&, jspace::Vector&)): /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:544:48: error: expression list treated as compound expression in initializer [-fpermissive] /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:544:48: warning: left operand of comma operator has no effect [-Wunused-value] /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:544:48: warning: right operand of comma operator has no effect [-Wunused-value] /home/jack/Code/stanfordwbc/tutorials/tutsim.cpp:544:48: error: invalid conversion from const char to Window {aka long unsigned int} [-fpermissive] /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:544:12: warning: unused variable win [-Wunused-variable] make[2]: * [tutorials/CMakeFiles/tut.dir/tutsim.cpp.o] Error 1 make[2]: Leaving directory `/home/jack/Code/stanford_wbc/build' make[1]: * [tutorials/CMakeFiles/tut.dir/all] Error 2 make[1]: Leaving directory`/home/jack/Code/stanford_wbc/build' make: *\ [all] Error 2

-Jack

On Mon, Feb 27, 2012 at 7:20 AM, Roland Philippsen < reply@reply.github.com

wrote:

Jack,

Ah, yes that could indeed have been done more properly. The trouble is the Window class name in the anonymous namespace, I thought C++ resolved symbols there first but maybe not. I just pushed a fix, can you let me know if it works for you?

Cheers, Roland

On 2/25/12 6:25 AM, Jack Hall wrote:

stanford_wbc fails to build on Fedora Linux. A Window class is defined in tutsim.cpp, but X11 already has a typedef by the same name in X.h. I compiled with:

Fedora 16 on x86_64 gcc 4.6.2 cmake 2.8.7 boost 1.47.0 fltk 1.3.0 gtest 1.5.0

These are all up-to-date for this distro. The failed part of the build gave me:

[ 86%] Building CXX object tutorials/CMakeFiles/tut.dir/tutsim.cpp.o cd /home/jack/Code/stanford_wbc/build/tutorials && /usr/bin/c++ -DLINUX -DTIXML_USE_STL -DHAVE_GTEST -DTUTROB_XML_PATH_STR=\"/home/jack/Code/stanford_wbc/tutorials/tutrob.xml\" -g -I/usr/include/eigen2 -I/home/jack/Code/stanford_wbc/tutorials/../jspace -I/home/jack/Code/stanford_wbc/tutorials/../tao -I/home/jack/Code/stanford_wbc/tutorials/../opspace/include -pipe -Wall -O0 -o CMakeFiles/tut.dir/tutsim.cpp.o -c /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp: In member function void {anonymous}::Simulator::tick(): /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:313:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] /home/jack/Code/stanfordwbc/tutorials/tutsim.cpp: In static member function static int tutsim::run(bool ()(size_t, double, double, jspace::State&, jspace::Vector&)): /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:544:3: error: reference to Window is ambiguous /usr/include/X11/X.h:96:13: error: candidates are: typedef XID Window /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:90:9: error: class {anonymous}::Window /home/jack/Code/stanfordwbc/tutorials/tutsim.cpp:544:10: error: expected ; before win make[2]: ** [tutorials/CMakeFiles/tut.dir/tutsim.cpp.o] Error 1 make[2]: Leaving directory /home/jack/Code/stanford_wbc/build' make[1]: *** [tutorials/CMakeFiles/tut.dir/all] Error 2 make[1]: Leaving directory/home/jack/Code/stanford_wbc/build' make: *\ [all] Error 2


Reply to this email directly or view it on GitHub: https://github.com/poftwaresatent/stanford_wbc/issues/4

Dr. Roland Philippsen Assistant Professor, Halmstad University Kristian IV:x vg 3, 302 50 Halmstad, Sweden office: E527 telephone: +46 (0) 35 167 249 http://hh.se/


Reply to this email directly or view it on GitHub:

https://github.com/poftwaresatent/stanford_wbc/issues/4#issuecomment-4193284

poftwaresatent commented 12 years ago

Jack,

Very interesting, GCC does not recognize the initializer line. Probably means it now resolved the ambiguity in a way contrary to my intentions.

It works just fine for me under Macports. Haven't tried it on Linux for a while though, GCC tends to be way ahead there (and thus stricter). Don't have access to my workstation right now, am travelling for a couple of days.

I've pushed another attempted fix (renamed Window to TSWindow, heehee), does that work? Otherwise, feel free to send me a patch... I may try to fire up Fedora in a virtual machine if I get around to it, but no promise.

Roland

On 2/27/12 3:08 PM, Jack Hall wrote:

Roland,

The compile still fails, but with a stranger error this time. The syntax you used when creating/initializing the Window object seems a little weird, but I haven't ever used anonymous namespaces...

[ 86%] Building CXX object tutorials/CMakeFiles/tut.dir/tutsim.cpp.o cd /home/jack/Code/stanford_wbc/build/tutorials && /usr/bin/c++ -DLINUX -DTIXML_USE_STL -DHAVE_GTEST -DTUTROB_XML_PATH_STR=\"/home/jack/Code/stanford_wbc/tutorials/tutrob.xml\" -g -I/usr/include/eigen2 -I/home/jack/Code/stanford_wbc/tutorials/../jspace -I/home/jack/Code/stanford_wbc/tutorials/../tao -I/home/jack/Code/stanford_wbc/tutorials/../opspace/include -pipe -Wall -O0 -o CMakeFiles/tut.dir/tutsim.cpp.o -c /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp: In member function void {anonymous}::Simulator::tick(): /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:313:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] /home/jack/Code/stanfordwbc/tutorials/tutsim.cpp: In static member function static int tutsim::run(bool ()(size_t, double, double, jspace::State&, jspace::Vector&)): /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:544:48: error: expression list treated as compound expression in initializer [-fpermissive] /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:544:48: warning: left operand of comma operator has no effect [-Wunused-value] /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:544:48: warning: right operand of comma operator has no effect [-Wunused-value] /home/jack/Code/stanfordwbc/tutorials/tutsim.cpp:544:48: error: invalid conversion from const char to Window {aka long unsigned int} [-fpermissive] /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:544:12: warning: unused variable win [-Wunused-variable] make[2]: * [tutorials/CMakeFiles/tut.dir/tutsim.cpp.o] Error 1 make[2]: Leaving directory `/home/jack/Code/stanford_wbc/build' make[1]: * [tutorials/CMakeFiles/tut.dir/all] Error 2 make[1]: Leaving directory`/home/jack/Code/stanford_wbc/build' make: *\ [all] Error 2

-Jack

On Mon, Feb 27, 2012 at 7:20 AM, Roland Philippsen < reply@reply.github.com

wrote:

Jack,

Ah, yes that could indeed have been done more properly. The trouble is the Window class name in the anonymous namespace, I thought C++ resolved symbols there first but maybe not. I just pushed a fix, can you let me know if it works for you?

Cheers, Roland

On 2/25/12 6:25 AM, Jack Hall wrote:

stanford_wbc fails to build on Fedora Linux. A Window class is defined in tutsim.cpp, but X11 already has a typedef by the same name in X.h. I compiled with:

Fedora 16 on x86_64 gcc 4.6.2 cmake 2.8.7 boost 1.47.0 fltk 1.3.0 gtest 1.5.0

These are all up-to-date for this distro. The failed part of the build gave me:

[ 86%] Building CXX object tutorials/CMakeFiles/tut.dir/tutsim.cpp.o cd /home/jack/Code/stanford_wbc/build/tutorials && /usr/bin/c++ -DLINUX -DTIXML_USE_STL -DHAVE_GTEST -DTUTROB_XML_PATH_STR=\"/home/jack/Code/stanford_wbc/tutorials/tutrob.xml\" -g -I/usr/include/eigen2 -I/home/jack/Code/stanford_wbc/tutorials/../jspace -I/home/jack/Code/stanford_wbc/tutorials/../tao -I/home/jack/Code/stanford_wbc/tutorials/../opspace/include -pipe -Wall -O0 -o CMakeFiles/tut.dir/tutsim.cpp.o -c /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp: In member function void {anonymous}::Simulator::tick(): /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:313:29: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] /home/jack/Code/stanfordwbc/tutorials/tutsim.cpp: In static member function static int tutsim::run(bool ()(size_t, double, double, jspace::State&, jspace::Vector&)): /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:544:3: error: reference to Window is ambiguous /usr/include/X11/X.h:96:13: error: candidates are: typedef XID Window /home/jack/Code/stanford_wbc/tutorials/tutsim.cpp:90:9: error: class {anonymous}::Window /home/jack/Code/stanfordwbc/tutorials/tutsim.cpp:544:10: error: expected ; before win make[2]: ** [tutorials/CMakeFiles/tut.dir/tutsim.cpp.o] Error 1 make[2]: Leaving directory /home/jack/Code/stanford_wbc/build' make[1]: *** [tutorials/CMakeFiles/tut.dir/all] Error 2 make[1]: Leaving directory/home/jack/Code/stanford_wbc/build' make: *\ [all] Error 2


Reply to this email directly or view it on GitHub: https://github.com/poftwaresatent/stanford_wbc/issues/4

Dr. Roland Philippsen Assistant Professor, Halmstad University Kristian IV:x vg 3, 302 50 Halmstad, Sweden office: E527 telephone: +46 (0) 35 167 249 http://hh.se/


Reply to this email directly or view it on GitHub:

https://github.com/poftwaresatent/stanford_wbc/issues/4#issuecomment-4193284


Reply to this email directly or view it on GitHub: https://github.com/poftwaresatent/stanford_wbc/issues/4#issuecomment-4193990

Dr. Roland Philippsen Assistant Professor, Halmstad University Kristian IV:x väg 3, 302 50 Halmstad, Sweden office: E527 telephone: +46 (0) 35 167 249 http://hh.se/

jackhall commented 12 years ago

Changing the class name worked fine for that part of the build, so that's good. Unfortunately, I ran into more problems later in the build, specifically with tut05_opspace_and_parameters.cpp. It gives me the following errors:

[ 91%] Building CXX object tutorials/CMakeFiles/tut05_opspace_and_parameters.dir/tut05_opspace_and_parameters.cpp.o cd /home/jack/Code/stanford_wbc/build/tutorials && /usr/bin/c++ -DLINUX -DTIXML_USE_STL -DHAVE_GTEST -DTUTROB_XML_PATH_STR=\"/home/jack/Code/stanford_wbc/tutorials/tutrob.xml\" -g -I/usr/include/eigen2 -I/home/jack/Code/stanford_wbc/tutorials/../jspace -I/home/jack/Code/stanford_wbc/tutorials/../tao -I/home/jack/Code/stanford_wbc/tutorials/../opspace/include -pipe -Wall -O0 -o CMakeFiles/tut05_opspace_and_parameters.dir/tut05_opspace_and_parameters.cpp.o -c /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:96:21: error: expected unqualified-id before ‘int’ /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:130:21: error: expected unqualified-id before ‘int’ /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:337:1: error: expected ‘}’ at end of input /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp: In constructor ‘tut05::PTask::PTask()’: /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:75:2: error: class ‘tut05::PTask’ does not have any field named ‘initialized’ /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:77:36: error: ‘goalpos’ was not declared in this scope /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:78:36: error: ‘goalvel’ was not declared in this scope /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp: In member function ‘void tut05::PTask::updateStateAndJacobian(const jspace::Model&)’: /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:93:7: error: ‘curvel’ was not declared in this scope /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp: At global scope: /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:94:5: error: expected unqualified-id at end of input /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:94:5: error: expected ‘}’ at end of input make[2]: * [tutorials/CMakeFiles/tut05_opspace_and_parameters.dir/tut05_opspace_and_parameters.cpp.o] Error 1 make[2]: Leaving directory `/home/jack/Code/stanford_wbc/build' make[1]: * [tutorials/CMakeFiles/tut05_opspace_and_parameters.dir/all] Error 2 make[1]: Leaving directory`/home/jack/Code/stanford_wbc/build' make: *\ [all] Error 2

I'll be trying to figure out how to fix this on my own; it seems to involve some problem with the jspace::Status class. But could you let me know if you find a solution?

poftwaresatent commented 12 years ago

Jack,

This one has me stumped. Could you email me your version of tut05_opspace_and_parameters.cpp?

The error message "expected ‘}’ at end of input" looks really suspicious. I'm wondering if you could possibly have introduced an editing glitch or something? Not necessarily inside the file being compiled, but something in a header or so...

Did you try wiping away your build directory and rerunning cmake?

Otherwise I'll try to replicate the errors you're getting in a virtual machine.

Cheers, Roland

On 3/2/12 9:54 PM, Jack Hall wrote:

Changing the class name worked fine for that part of the build, so that's good. Unfortunately, I ran into more problems later in the build, specifically with tut05_opspace_and_parameters.cpp. It gives me the following errors:

[ 91%] Building CXX object tutorials/CMakeFiles/tut05_opspace_and_parameters.dir/tut05_opspace_and_parameters.cpp.o cd /home/jack/Code/stanford_wbc/build/tutorials && /usr/bin/c++ -DLINUX -DTIXML_USE_STL -DHAVE_GTEST -DTUTROB_XML_PATH_STR=\"/home/jack/Code/stanford_wbc/tutorials/tutrob.xml\" -g -I/usr/include/eigen2 -I/home/jack/Code/stanford_wbc/tutorials/../jspace -I/home/jack/Code/stanford_wbc/tutorials/../tao -I/home/jack/Code/stanford_wbc/tutorials/../opspace/include -pipe -Wall -O0 -o CMakeFiles/tut05_opspace_and_parameters.dir/tut05_opspace_and_parameters.cpp.o -c /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:96:21: error: expected unqualified-id before ‘int’ /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:130:21: error: expected unqualified-id before ‘int’ /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:337:1: error: expected ‘}’ at end of input /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp: In constructor ‘tut05::PTask::PTask()’: /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:75:2: error: class ‘tut05::PTask’ does not have any field named ‘initialized’ /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:77:36: error: ‘goalpos’ was not declared in this scope /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:78:36: error: ‘goalvel’ was not declared in this scope /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp: In member function ‘void tut05::PTask::updateStateAndJacobian(const jspace::Model&)’: /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:93:7: error: ‘curvel’ was not declared in this scope /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp: At global scope: /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:94:5: error: expected unqualified-id at end of input /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:94:5: error: expected ‘}’ at end of input make[2]: * [tutorials/CMakeFiles/tut05_opspace_and_parameters.dir/tut05_opspace_and_parameters.cpp.o] Error 1 make[2]: Leaving directory `/home/jack/Code/stanford_wbc/build' make[1]: * [tutorials/CMakeFiles/tut05_opspace_and_parameters.dir/all] Error 2 make[1]: Leaving directory`/home/jack/Code/stanford_wbc/build' make: *\ [all] Error 2

I'll be trying to figure out how to fix this on my own; it seems to involve some problem with the jspace::Status class. But could you let me know if you find a solution?


Reply to this email directly or view it on GitHub: https://github.com/poftwaresatent/stanford_wbc/issues/4#issuecomment-4293868

Dr. Roland Philippsen Assistant Professor, Halmstad University Kristian IV:x väg 3, 302 50 Halmstad, Sweden office: E527 telephone: +46 (0) 35 167 249 http://hh.se/

jackhall commented 12 years ago

Roland,

I actually re-cloned the whole repository from GitHub. Whatever is committed there is what I'm trying to compile. Just to make sure, I've attached tut05_opspace_and_parameters.cpp.

-Jack

include "tutsim.hpp"

include <opspace/task_library.hpp>

include <jspace/test/sai_util.hpp>

include <boost/shared_ptr.hpp>

include <FL/fl_draw.H>

include

namespace tut05 {      using namespace jspace;

  class PTask : public opspace::Task {   public:     PTask()       : opspace::Task("tut05::PTask"), initialized(false)     {       declareParameter("goalpos", &goalpos);       declareParameter("goalvel", &goalvel_);     }          void updateStateAndJacobian(Model const & model)     {       jspace::Transform ee_transform;       model.computeGlobalFrame(model.getNode(3), // hardcoded end-effector ID = 3       0, 0, -1, // hardcoded ctrl point 1m down along Z axis       eetransform);       actual = ee_transform.translation().block(1, 0, 2, 1); // extract 2D point (y, z)       Matrix Jfull;       model.computeJacobian(model.getNode(3),    eetransform.translation(),    Jfull);       jacobian = Jfull.block(1, 0, 2, Jfull.cols()); // extract the Y and Z rows       curvel = jacobian * model.getState().velocity;     }          virtual jspace::Status init(jspace::Model const & model)     {       //////////////////////////////////////////////////       // Initialize our PD parameters.              kp = 32.0;       kd = 8.0;              //////////////////////////////////////////////////       // The Jacobian becomes important now, because we are going to       // use it to compute the mapping from operational space force to       // joint torques. For real applications, it would furthermore be       // used to determine the nullspace of the operational point       // motion (but not in this tutorial where we simply let the       // robot "flop around" in the task nullspace).              updateStateAndJacobian(model);              //////////////////////////////////////////////////       // Initialize our goal to the current state.              goalpos = actual;       goalvel = jspace::Vector::Zero(2);              //////////////////////////////////////////////////       // No initialization problems to report: the default constructor       // of jspace::Status yields an instance that signifies success.              initialized = true;       jspace::Status ok;       return ok;     }               virtual jspace::Status update(jspace::Model const & model)     {       //////////////////////////////////////////////////       // Lazy init...              if ( ! initialized ) { init(model);       }              //////////////////////////////////////////////////       // Update the state and Jacobian of our task.              updateStateAndJacobian(model);              //////////////////////////////////////////////////       // Compute PD control forces (in task space). Later, in the       // control loop, our Jacobian will be used to map them to       // joint-space.  Inertial and gravity compensation happens       // there, too. In effect, an operational space task only worries       // about desired accelerations within its own task space.              command = kp * (goalpos - actual) + kd * (goalvel - curvel_);              jspace::Status ok;       return ok;     }

    bool initialized;         double kp, kd;     jspace::Vector curvel;     jspace::Vector goalpos, goalvel;          // Make these two protected fields publicly available for easier     // info messages.     opspace::Task::actual;     opspace::Task::jacobian;   };    }

static std::string model_filename(TUTROB_XML_PATH_STR); static boost::shared_ptrjspace::Model model; static tut05::PTask ptask; static opspace::Parameter * goalpos; static opspace::Parameter * goalvel; static size_t mode;

static bool servo_cb(size_t toggle_count,     double wall_time_ms,     double sim_time_ms,     jspace::State & state,     jspace::Vector & command) {   mode = toggle_count % 4;   static sizet prevmode(42);      if (0 == mode) {          //////////////////////////////////////////////////     // Re-initialize simulator          for (int ii(0); ii < state.position.rows(); ++ii) {       static double const amplitude(0.5 * M_PI);       double const omega(1.0 + 0.1 * ii);       double const phase(omega * 1e-3 * wall_timems);       state.position[ii] =         amplitude * sin(phase);       state.velocity_[ii] = omega * amplitude * cos(phase);     }     prevmode = mode;     return false;        }      //////////////////////////////////////////////////   // Update the model to reflect the current robot state.      model->update(state);      if (0 == prevmode) {     jspace::Status const st(ptask.init(_model));     if ( ! st) {       errx(EXIT_FAILURE, "ptask.init() failed: %s", st.errstr.c_str());     }   }      static jspace::Vector pos(2), vel(2);   static double const ox(0.2);   static double const oy(0.37);   static double const amp(2.5);   double const px(ox * 1e-3 * wall_time_ms);   double const py(oy * 1e-3 * wall_time_ms);   pos <<      amp * sin(px),      amp * sin(py);   vel << ox * amp * cos(px), oy * amp * cos(py);   if ( ! goalpos->set(pos)) {     errx(EXIT_FAILURE, "failed to set end-effector goal position");   }   if ( ! goalvel->set(vel)) {     errx(EXIT_FAILURE, "failed to set end-effector goal velocity");   }      ptask.update(_model);      //////////////////////////////////////////////////   // The end-effector position task computes a desired acceleration in   // Cartesian space. In order to send it to the joints as desired   // torques, this needs to be translated from operational space to   // joint space. In the opspace library, this is the job of   // opspace::Controller::computeCommand(). However, that needs a bit   // of extra infrastructure, so here we simply hardcode the   // fundamental equation without any frosting...      jspace::Matrix aa;   model->getMassInertia(aa);   jspace::Vector gg;   model->getGravity(gg);   jspace::Vector cc;   model->getCoriolisCentrifugal(cc);      char const * mode_desc;   switch (mode) {   case 1:     mode_desc = "no compensation\n";     command = ptask.getJacobian().transpose() * ptask.getCommand();     break;   case 2:     mode_desc = "only gravity compensation\n";     command = ptask.getJacobian().transpose() * ptask.getCommand() + gg;     break;   default:     mode_desc = "full compensation\n";     command = aa * ptask.getJacobian().transpose() * ptask.getCommand() + gg + cc;   }      static size_t iteration(0);   if (0 == (iteration % 100)) {     std::cerr << "**\n"      << mode_desc;     jspace::prettyprint(state.position, std::cerr, "  jpos", "    ");     jspace::prettyprint(state.velocity, std::cerr, "  jvel", "    ");     jspace::prettyprint(ptask.actual, std::cerr, "  ppos", "    ");     jspace::prettyprint(ptask.curvel, std::cerr, "  pvel", "    ");     jspace::prettyprint(ptask.goalpos, std::cerr, "  goalpos", "    ");     jspace::prettyprint(ptask.goalvel, std::cerr, "  goalvel", "    ");     jspace::prettyprint(ptask.jacobian, std::cerr, "  Jacobian", "    ");     jspace::pretty_print(command, std::cerr, "  command", "    ");   }   ++iteration;      prevmode = mode;   return true; }

static void draw_cb(double x0, double y0, double scale) {   if (0 != mode) {          //////////////////////////////////////////////////     // On a side-note: we plot the YZ plane, X is sticking out of the     // screen (but the robot is planar anyway). However, the     // tut05::PTask's planar operational space already takes that into     // account.          fl_color(255, 100, 100);     fl_line_style(FL_SOLID, 3, 0);          double const gx(goalpos->getVector()->x());     double const gy(goalpos->getVector()->y());     int const rr(ceil(0.2 * scale));     int const dd(2 * rr);     fl_arc(int(x0 + gx * scale) - rr, int(y0 - gy * scale) - rr, dd, dd, 0.0, 360.0);          double const vx(goalvel->getVector()->x());     double const vy(goalvel->getVector()->y());     double const px(gx + vx * 0.1);     double const py(gy + vy * 0.1);     // fl_line(x0 + (gx + 0.2) * scale, y0 - gy * scale,     //    x0 + (gx - 0.2) * scale, y0 - gy * scale);     // fl_line(x0 + gx * scale, y0 - (gy + 0.2) * scale,     //    x0 + gx * scale, y0 - (gy - 0.2) * scale);     fl_color(255, 255, 100);     fl_line(x0 + gx * scale, y0 - gy * scale,    x0 + px * scale, y0 - py * scale);   } }

int main(int argc, char \ argv) {   try {     model.reset(jspace::test::parse_sai_xml_file(model_filename, true));     goalpos = ptask.lookupParameter("goalpos", opspace::PARAMETER_TYPE_VECTOR);     if ( ! goalpos) {       errx(EXIT_FAILURE, "failed to find appropriate goalpos parameter");     }     goalvel = ptask.lookupParameter("goalvel", opspace::PARAMETER_TYPE_VECTOR);     if ( ! goalvel) {       errx(EXIT_FAILURE, "failed to find appropriate goalvel parameter");     }   }   catch (std::runtime_error const & ee) {     errx(EXIT_FAILURE, "%s", ee.what());   }   tutsim::set_draw_cb(draw_cb);   return tutsim::run(servo_cb); }

On Sun, Mar 4, 2012 at 12:34 PM, Roland Philippsen < reply@reply.github.com

wrote:

Jack,

This one has me stumped. Could you email me your version of tut05_opspace_and_parameters.cpp?

The error message "expected } at end of input" looks really suspicious. I'm wondering if you could possibly have introduced an editing glitch or something? Not necessarily inside the file being compiled, but something in a header or so...

Did you try wiping away your build directory and rerunning cmake?

Otherwise I'll try to replicate the errors you're getting in a virtual machine.

Cheers, Roland

On 3/2/12 9:54 PM, Jack Hall wrote:

Changing the class name worked fine for that part of the build, so that's good. Unfortunately, I ran into more problems later in the build, specifically with tut05_opspace_and_parameters.cpp. It gives me the following errors:

[ 91%] Building CXX object tutorials/CMakeFiles/tut05_opspace_and_parameters.dir/tut05_opspace_and_parameters.cpp.o cd /home/jack/Code/stanford_wbc/build/tutorials && /usr/bin/c++ -DLINUX -DTIXML_USE_STL -DHAVE_GTEST -DTUTROB_XML_PATH_STR=\"/home/jack/Code/stanford_wbc/tutorials/tutrob.xml\" -g -I/usr/include/eigen2 -I/home/jack/Code/stanford_wbc/tutorials/../jspace -I/home/jack/Code/stanford_wbc/tutorials/../tao -I/home/jack/Code/stanford_wbc/tutorials/../opspace/include -pipe -Wall -O0 -o CMakeFiles/tut05_opspace_and_parameters.dir/tut05_opspace_and_parameters.cpp.o -c /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:96:21: error: expected unqualified-id before int

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:130:21: error: expected unqualified-id before int

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:337:1: error: expected } at end of input /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp: In constructor tut05::PTask::PTask():

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:75:2: error: class tut05::PTask does not have any field named initialized

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:77:36: error: goalpos was not declared in this scope

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:78:36: error: goalvel was not declared in this scope /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp: In member function void tut05::PTask::updateStateAndJacobian(const jspace::Model&):

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:93:7: error: curvel was not declared in this scope /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp: At global scope:

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:94:5: error: expected unqualified-id at end of input

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:94:5: error: expected } at end of input make[2]: [tutorials/CMakeFiles/tut05_opspace_and_parameters.dir/tut05_opspace_and_parameters.cpp.o] Error 1 make[2]: Leaving directory `/home/jack/Code/stanford_wbc/build' make[1]: [tutorials/CMakeFiles/tut05_opspace_and_parameters.dir/all] Error 2 make[1]: Leaving directory`/home/jack/Code/stanford_wbc/build' make: *\ [all] Error 2

I'll be trying to figure out how to fix this on my own; it seems to involve some problem with the jspace::Status class. But could you let me know if you find a solution?


Reply to this email directly or view it on GitHub:

https://github.com/poftwaresatent/stanford_wbc/issues/4#issuecomment-4293868

Dr. Roland Philippsen Assistant Professor, Halmstad University Kristian IV:x vg 3, 302 50 Halmstad, Sweden office: E527 telephone: +46 (0) 35 167 249 http://hh.se/


Reply to this email directly or view it on GitHub:

https://github.com/poftwaresatent/stanford_wbc/issues/4#issuecomment-4311932

poftwaresatent commented 12 years ago

Jack,

I can now replicate the error on a freshly installed Fedora 16. Very weird indeed, makes me curious. But I won't have much time to work on it until Wednesday probably, so if you find the cause in the meantime please let me know.

Roland

On 3/4/12 8:14 PM, Jack Hall wrote:

Roland,

I actually re-cloned the whole repository from GitHub. Whatever is committed there is what I'm trying to compile. Just to make sure, I've attached tut05_opspace_and_parameters.cpp.

-Jack

On Sun, Mar 4, 2012 at 12:34 PM, Roland Philippsen < reply@reply.github.com

wrote:

Jack,

This one has me stumped. Could you email me your version of tut05_opspace_and_parameters.cpp?

The error message "expected } at end of input" looks really suspicious. I'm wondering if you could possibly have introduced an editing glitch or something? Not necessarily inside the file being compiled, but something in a header or so...

Did you try wiping away your build directory and rerunning cmake?

Otherwise I'll try to replicate the errors you're getting in a virtual machine.

Cheers, Roland

On 3/2/12 9:54 PM, Jack Hall wrote:

Changing the class name worked fine for that part of the build, so that's good. Unfortunately, I ran into more problems later in the build, specifically with tut05_opspace_and_parameters.cpp. It gives me the following errors:

[ 91%] Building CXX object tutorials/CMakeFiles/tut05_opspace_and_parameters.dir/tut05_opspace_and_parameters.cpp.o cd /home/jack/Code/stanford_wbc/build/tutorials && /usr/bin/c++ -DLINUX -DTIXML_USE_STL -DHAVE_GTEST -DTUTROB_XML_PATH_STR=\"/home/jack/Code/stanford_wbc/tutorials/tutrob.xml\" -g -I/usr/include/eigen2 -I/home/jack/Code/stanford_wbc/tutorials/../jspace -I/home/jack/Code/stanford_wbc/tutorials/../tao -I/home/jack/Code/stanford_wbc/tutorials/../opspace/include -pipe -Wall -O0 -o CMakeFiles/tut05_opspace_and_parameters.dir/tut05_opspace_and_parameters.cpp.o -c /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:96:21: error: expected unqualified-id before int

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:130:21: error: expected unqualified-id before int

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:337:1: error: expected } at end of input /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp: In constructor tut05::PTask::PTask():

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:75:2: error: class tut05::PTask does not have any field named initialized

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:77:36: error: goalpos was not declared in this scope

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:78:36: error: goalvel was not declared in this scope /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp: In member function void tut05::PTask::updateStateAndJacobian(const jspace::Model&):

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:93:7: error: curvel was not declared in this scope /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp: At global scope:

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:94:5: error: expected unqualified-id at end of input

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:94:5: error: expected } at end of input make[2]: [tutorials/CMakeFiles/tut05_opspace_and_parameters.dir/tut05_opspace_and_parameters.cpp.o] Error 1 make[2]: Leaving directory `/home/jack/Code/stanford_wbc/build' make[1]: [tutorials/CMakeFiles/tut05_opspace_and_parameters.dir/all] Error 2 make[1]: Leaving directory`/home/jack/Code/stanford_wbc/build' make: *\ [all] Error 2

I'll be trying to figure out how to fix this on my own; it seems to involve some problem with the jspace::Status class. But could you let me know if you find a solution?


Reply to this email directly or view it on GitHub:

https://github.com/poftwaresatent/stanford_wbc/issues/4#issuecomment-4293868

Dr. Roland Philippsen Assistant Professor, Halmstad University Kristian IV:x vg 3, 302 50 Halmstad, Sweden office: E527 telephone: +46 (0) 35 167 249 http://hh.se/


Reply to this email directly or view it on GitHub:

https://github.com/poftwaresatent/stanford_wbc/issues/4#issuecomment-4311932


Reply to this email directly or view it on GitHub: https://github.com/poftwaresatent/stanford_wbc/issues/4#issuecomment-4312290

Dr. Roland Philippsen Assistant Professor, Halmstad University Kristian IV:x väg 3, 302 50 Halmstad, Sweden office: E527 telephone: +46 (0) 35 167 249 http://hh.se/

poftwaresatent commented 12 years ago

Jack,

the trouble is that somewhere there is a preprocessor symbol called "Status" which gets defined to be "int" and that messes things up big time. I haven't had time yet to track it down more precisely, but it's certainly not within the stanford_wbc project.

This may turn ugly, I really don't want to have to change a properly scoped C++ symbol just because someone else somewhere else is doing improper things with the preprocessor... but we'll see. I'll keep you posted.

Roland

On 3/4/12 8:14 PM, Jack Hall wrote:

Roland,

I actually re-cloned the whole repository from GitHub. Whatever is committed there is what I'm trying to compile. Just to make sure, I've attached tut05_opspace_and_parameters.cpp.

-Jack

On Sun, Mar 4, 2012 at 12:34 PM, Roland Philippsen < reply@reply.github.com

wrote:

Jack,

This one has me stumped. Could you email me your version of tut05_opspace_and_parameters.cpp?

The error message "expected } at end of input" looks really suspicious. I'm wondering if you could possibly have introduced an editing glitch or something? Not necessarily inside the file being compiled, but something in a header or so...

Did you try wiping away your build directory and rerunning cmake?

Otherwise I'll try to replicate the errors you're getting in a virtual machine.

Cheers, Roland

On 3/2/12 9:54 PM, Jack Hall wrote:

Changing the class name worked fine for that part of the build, so that's good. Unfortunately, I ran into more problems later in the build, specifically with tut05_opspace_and_parameters.cpp. It gives me the following errors:

[ 91%] Building CXX object tutorials/CMakeFiles/tut05_opspace_and_parameters.dir/tut05_opspace_and_parameters.cpp.o cd /home/jack/Code/stanford_wbc/build/tutorials && /usr/bin/c++ -DLINUX -DTIXML_USE_STL -DHAVE_GTEST -DTUTROB_XML_PATH_STR=\"/home/jack/Code/stanford_wbc/tutorials/tutrob.xml\" -g -I/usr/include/eigen2 -I/home/jack/Code/stanford_wbc/tutorials/../jspace -I/home/jack/Code/stanford_wbc/tutorials/../tao -I/home/jack/Code/stanford_wbc/tutorials/../opspace/include -pipe -Wall -O0 -o CMakeFiles/tut05_opspace_and_parameters.dir/tut05_opspace_and_parameters.cpp.o -c /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:96:21: error: expected unqualified-id before int

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:130:21: error: expected unqualified-id before int

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:337:1: error: expected } at end of input /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp: In constructor tut05::PTask::PTask():

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:75:2: error: class tut05::PTask does not have any field named initialized

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:77:36: error: goalpos was not declared in this scope

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:78:36: error: goalvel was not declared in this scope /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp: In member function void tut05::PTask::updateStateAndJacobian(const jspace::Model&):

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:93:7: error: curvel was not declared in this scope /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp: At global scope:

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:94:5: error: expected unqualified-id at end of input

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:94:5: error: expected } at end of input make[2]: [tutorials/CMakeFiles/tut05_opspace_and_parameters.dir/tut05_opspace_and_parameters.cpp.o] Error 1 make[2]: Leaving directory `/home/jack/Code/stanford_wbc/build' make[1]: [tutorials/CMakeFiles/tut05_opspace_and_parameters.dir/all] Error 2 make[1]: Leaving directory`/home/jack/Code/stanford_wbc/build' make: *\ [all] Error 2

I'll be trying to figure out how to fix this on my own; it seems to involve some problem with the jspace::Status class. But could you let me know if you find a solution?


Reply to this email directly or view it on GitHub:

https://github.com/poftwaresatent/stanford_wbc/issues/4#issuecomment-4293868

Dr. Roland Philippsen Assistant Professor, Halmstad University Kristian IV:x vg 3, 302 50 Halmstad, Sweden office: E527 telephone: +46 (0) 35 167 249 http://hh.se/


Reply to this email directly or view it on GitHub:

https://github.com/poftwaresatent/stanford_wbc/issues/4#issuecomment-4311932


Reply to this email directly or view it on GitHub: https://github.com/poftwaresatent/stanford_wbc/issues/4#issuecomment-4312290

Dr. Roland Philippsen Assistant Professor, Halmstad University Kristian IV:x väg 3, 302 50 Halmstad, Sweden office: E527 telephone: +46 (0) 35 167 249 http://hh.se/

poftwaresatent commented 12 years ago

Jack,

Okay, it's from /usr/include/X11/Xib.h which contains a "#define Status int." That explains it, but the weird thing is that this only leads to an error on Fedora, I haven't noticed it on OS X, Debian, and Ubuntu in spite of the exact same define being present in that header on those systems.

Anyway, I pushed a workaround. Could you pull and test?

Roland

On 3/6/12 4:25 PM, Roland Philippsen wrote:

Jack,

the trouble is that somewhere there is a preprocessor symbol called "Status" which gets defined to be "int" and that messes things up big time. I haven't had time yet to track it down more precisely, but it's certainly not within the stanford_wbc project.

This may turn ugly, I really don't want to have to change a properly scoped C++ symbol just because someone else somewhere else is doing improper things with the preprocessor... but we'll see. I'll keep you posted.

Roland

On 3/4/12 8:14 PM, Jack Hall wrote:

Roland,

I actually re-cloned the whole repository from GitHub. Whatever is committed there is what I'm trying to compile. Just to make sure, I've attached tut05_opspace_and_parameters.cpp.

-Jack

On Sun, Mar 4, 2012 at 12:34 PM, Roland Philippsen < reply@reply.github.com

wrote:

Jack,

This one has me stumped. Could you email me your version of tut05_opspace_and_parameters.cpp?

The error message "expected } at end of input" looks really suspicious. I'm wondering if you could possibly have introduced an editing glitch or something? Not necessarily inside the file being compiled, but something in a header or so...

Did you try wiping away your build directory and rerunning cmake?

Otherwise I'll try to replicate the errors you're getting in a virtual machine.

Cheers, Roland

On 3/2/12 9:54 PM, Jack Hall wrote:

Changing the class name worked fine for that part of the build, so that's good. Unfortunately, I ran into more problems later in the build, specifically with tut05_opspace_and_parameters.cpp. It gives me the following errors:

[ 91%] Building CXX object tutorials/CMakeFiles/tut05_opspace_and_parameters.dir/tut05_opspace_and_parameters.cpp.o cd /home/jack/Code/stanford_wbc/build/tutorials && /usr/bin/c++ -DLINUX -DTIXML_USE_STL -DHAVE_GTEST -DTUTROB_XML_PATH_STR=\"/home/jack/Code/stanford_wbc/tutorials/tutrob.xml\" -g -I/usr/include/eigen2 -I/home/jack/Code/stanford_wbc/tutorials/../jspace -I/home/jack/Code/stanford_wbc/tutorials/../tao -I/home/jack/Code/stanford_wbc/tutorials/../opspace/include -pipe -Wall -O0 -o CMakeFiles/tut05_opspace_and_parameters.dir/tut05_opspace_and_parameters.cpp.o -c /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:96:21: error: expected unqualified-id before int

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:130:21: error: expected unqualified-id before int

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:337:1: error: expected } at end of input /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp: In constructor tut05::PTask::PTask():

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:75:2: error: class tut05::PTask does not have any field named initialized

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:77:36: error: goalpos was not declared in this scope

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:78:36: error: goalvel was not declared in this scope /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp: In member function void tut05::PTask::updateStateAndJacobian(const jspace::Model&):

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_andparameters.cpp:93:7: error: curvel was not declared in this scope /home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp: At global scope:

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:94:5: error: expected unqualified-id at end of input

/home/jack/Code/stanford_wbc/tutorials/tut05_opspace_and_parameters.cpp:94:5: error: expected } at end of input make[2]: [tutorials/CMakeFiles/tut05_opspace_and_parameters.dir/tut05_opspace_and_parameters.cpp.o] Error 1 make[2]: Leaving directory `/home/jack/Code/stanford_wbc/build' make[1]: [tutorials/CMakeFiles/tut05_opspace_and_parameters.dir/all] Error 2 make[1]: Leaving directory`/home/jack/Code/stanford_wbc/build' make: *\ [all] Error 2

I'll be trying to figure out how to fix this on my own; it seems to involve some problem with the jspace::Status class. But could you let me know if you find a solution?


Reply to this email directly or view it on GitHub:

https://github.com/poftwaresatent/stanford_wbc/issues/4#issuecomment-4293868

Dr. Roland Philippsen Assistant Professor, Halmstad University Kristian IV:x vg 3, 302 50 Halmstad, Sweden office: E527 telephone: +46 (0) 35 167 249 http://hh.se/


Reply to this email directly or view it on GitHub:

https://github.com/poftwaresatent/stanford_wbc/issues/4#issuecomment-4311932


Reply to this email directly or view it on GitHub: https://github.com/poftwaresatent/stanford_wbc/issues/4#issuecomment-4312290

Dr. Roland Philippsen Assistant Professor, Halmstad University Kristian IV:x väg 3, 302 50 Halmstad, Sweden office: E527 telephone: +46 (0) 35 167 249 http://hh.se/

jackhall commented 12 years ago

Everything builds now. Of the three tests documented in README.md, testTAO and testJspace run fine. opspace/testTask does not finish correctly, however. The output from the failed test is below, as run from stanford_wbc/build/opspace

$ ./testTask [==========] Running 4 tests from 2 test cases. [----------] Global test environment set-up. [----------] 2 tests from task [ RUN ] task.basics [ OK ] task.basics (8 ms) [ RUN ] task.jlimit /home/jack/Code/stanford_wbc/opspace/src/testTask.cpp:345: Failure Value of: st.ok Actual: false Expected: true failed to computeCommand: task table must have exactly 2 entries /home/jack/Code/stanford_wbc/opspace/src/testTask.cpp:345: Failure Value of: st.ok Actual: false Expected: true failed to computeCommand: task table must have exactly 2 entries /home/jack/Code/stanford_wbc/opspace/src/testTask.cpp:345: Failure Value of: st.ok Actual: false Expected: true failed to computeCommand: task table must have exactly 2 entries /home/jack/Code/stanford_wbc/opspace/src/testTask.cpp:345: Failure Value of: st.ok Actual: false Expected: true failed to computeCommand: task table must have exactly 2 entries /home/jack/Code/stanford_wbc/opspace/src/testTask.cpp:345: Failure Value of: st.ok Actual: false Expected: true failed to computeCommand: task table must have exactly 2 entries /home/jack/Code/stanford_wbc/opspace/src/testTask.cpp:345: Failure Value of: st.ok Actual: false Expected: true failed to computeCommand: task table must have exactly 2 entries [ FAILED ] task.jlimit (11 ms) [----------] 2 tests from task (19 ms total)

[----------] 2 tests from controller [ RUN ] controller.odd_even testTask: /usr/include/eigen2/Eigen/src/Core/Product.h:201: Eigen::Product<Lhs, Rhs, ProductMode>::Product(const Lhs&, const Rhs&) [with Lhs = Eigen::Matrix<double, 10000, 10000>, Rhs = Eigen::Matrix<double, 10000, 1>, LhsNested = const Eigen::Matrix<double, 10000, 10000>&, RhsNested = const Eigen::Matrix<double, 10000, 1>&, int ProductMode = 1]: Assertion `lhs.cols() == rhs.rows() && "invalid matrix product" && "if you wanted a coeff-wise or a dot product use the respective explicit functions"' failed. Aborted (core dumped)

poftwaresatent commented 12 years ago

Fixed one unit test, commented-out the other one because it is based on an assumption that has been invalidated by an old refactoring. In the process, I pulled the latest gtest into the 3rdparty directory, it now gets built and integrated automatically. The old setup with pointing to an external gtest directory was just too tedious, and in the meantime gtest recommends an integration via CMake anyway.

jackhall commented 12 years ago

Thank you so much for your help!