Giter VIP home page Giter VIP logo

Comments (5)

vsamy avatar vsamy commented on June 24, 2024

It works perfetly on my side. What compiler do you use? You can eventually add set(CMAKE_CXX_STANDARD 11) in the cmake.

You can also try this:

return { position, rotation, p, mu, nrGenerators };

or this

return wcl::ContactSurface{position, rotation, p, mu, nrGenerators};

from wrench-cone-lib.

wyqsnddd avatar wyqsnddd commented on June 24, 2024

Actually I already added set(CMAKE_CXX_STANDARD 11) but I still have the issue. I am using ubuntu 16.04 and

gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.11) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

I tried both of the modifications but end up with errors:
1.

return { position, rotation, p, mu, nrGenerators };
In function ‘wcl::ContactSurface wcl::rectangularSurface(double, double, const Vector3d&, const Matrix3d&, double, unsigned int)’:
/home/yuquan/local/wrench-cone-lib/src/ContactSurface.cpp:33:71: error: no matching function for call to ‘wcl::ContactSurface::ContactSurface(<brace-enclosed initializer list>)’
     return wcl::ContactSurface{position, rotation, p, mu, nrGenerators};
                                                                       ^
In file included from /home/yuquan/local/wrench-cone-lib/src/ContactSurface.cpp:19:0:
/home/yuquan/local/wrench-cone-lib/include/wcl/ContactSurface.h:30:19: note: candidate: wcl::ContactSurface::ContactSurface()
 struct WCL_DLLAPI ContactSurface {
                   ^
/home/yuquan/local/wrench-cone-lib/include/wcl/ContactSurface.h:30:19: note:   candidate expects 0 arguments, 5 provided
/home/yuquan/local/wrench-cone-lib/include/wcl/ContactSurface.h:30:19: note: candidate: wcl::ContactSurface::ContactSurface(const wcl::ContactSurface&)
/home/yuquan/local/wrench-cone-lib/include/wcl/ContactSurface.h:30:19: note:   candidate expects 1 argument, 5 provided
/home/yuquan/local/wrench-cone-lib/include/wcl/ContactSurface.h:30:19: note: candidate: wcl::ContactSurface::ContactSurface(wcl::ContactSurface&&)
/home/yuquan/local/wrench-cone-lib/include/wcl/ContactSurface.h:30:19: note:   candidate expects 1 argument, 5 provided
src/CMakeFiles/wcl.dir/build.make:65: recipe for target 'src/CMakeFiles/wcl.dir/ContactSurface.cpp.o' failed
make[2]: *** [src/CMakeFiles/wcl.dir/ContactSurface.cpp.o] Error 1
make[2]: Leaving directory '/home/yuquan/local/wrench-cone-lib/build'
CMakeFiles/Makefile2:1300: recipe for target 'src/CMakeFiles/wcl.dir/all' failed
make[1]: *** [src/CMakeFiles/wcl.dir/all] Error 2
make[1]: Leaving directory '/home/yuquan/local/wrench-cone-lib/build'
Makefile:143: recipe for target 'all' failed
make: *** [all] Error 2
return wcl::ContactSurface{position, rotation, p, mu, nrGenerators};
/home/yuquan/local/wrench-cone-lib/src/ContactSurface.cpp: In function ‘wcl::ContactSurface wcl::rectangularSurface(double, double, const Vector3d&, const Matrix3d&, double, unsigned int)’:
/home/yuquan/local/wrench-cone-lib/src/ContactSurface.cpp:34:54: error: could not convert ‘{position, rotation, p, mu, nrGenerators}’ from ‘<brace-enclosed initializer list>’ to ‘wcl::ContactSurface’
     return { position, rotation, p, mu, nrGenerators };
                                                      ^
src/CMakeFiles/wcl.dir/build.make:65: recipe for target 'src/CMakeFiles/wcl.dir/ContactSurface.cpp.o' failed
make[2]: *** [src/CMakeFiles/wcl.dir/ContactSurface.cpp.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/yuquan/local/wrench-cone-lib/build'
CMakeFiles/Makefile2:1300: recipe for target 'src/CMakeFiles/wcl.dir/all' failed
make[1]: *** [src/CMakeFiles/wcl.dir/all] Error 2
make[1]: Leaving directory '/home/yuquan/local/wrench-cone-lib/build'
Makefile:143: recipe for target 'all' failed
make: *** [all] Error 2

from wrench-cone-lib.

vsamy avatar vsamy commented on June 24, 2024

Ok, it is due to the default initialization of the ContactSurface.

from wrench-cone-lib.

vsamy avatar vsamy commented on June 24, 2024

GCC 5.4 is quite old, this behavior is solved from GCC 5.5 actually.
Try this:

wcl::ContactSurface rectangularSurface(.....)
{
    std::vector<Eigen::Vector3d> p;
    // all the emplace_back
#if defined(__GNUC__) && (__GNUC___ <= 5 && __GNUC_MINOR__ <= 4)
    wcl::ContactSurface cs;
    cs.position = position;
    cs.rotation = rotation;
    cs.points = std::move(p);
    cs.mu = mu;
    cs.nrGenerators = nrGenerators;
    return cs;
#else
    return { p, 0.2, 10 };
#endif
}

If it works, i will patch.

from wrench-cone-lib.

wyqsnddd avatar wyqsnddd commented on June 24, 2024

Good! It works on my side too, excellent!

from wrench-cone-lib.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.