Giter Site home page Giter Site logo

Comments (8)

jlblancoc avatar jlblancoc commented on June 18, 2024 1

Exactly 👍

from mrpt.

jlblancoc avatar jlblancoc commented on June 18, 2024 1

@jolting It was something else... I just found (the hard way..) that everything inside an if constexpr() is actually parsed by the compiler (even if the condition is false)... except if it's inside a template. Solution -> move that part to a template, and it's now working (ignoring) on humble too! 4b6e108

PS: before that, I also tried the declval trick without luck... :-( Thanks!!

from mrpt.

jlblancoc avatar jlblancoc commented on June 18, 2024

@ejalaa12 This has been finally addressed here:
67358e9

so MRPT >= v2.11.2 will use the new variance field.

from mrpt.

ejalaa12 avatar ejalaa12 commented on June 18, 2024

@jlblancoc awesome! I saw the commit, this a clever way of making sure the member exist.
I guess this makes it retro-compatibke with old version of the Range message as well.

from mrpt.

jlblancoc avatar jlblancoc commented on June 18, 2024

However, for some reason, the if constexpr trick fails on Humble... hmm....

https://build.ros2.org/job/Hdev__mrpt2__ubuntu_jammy_amd64/349/console

03:46:44 [ 92%] Building CXX object libs/ros2bridge/CMakeFiles/ros2bridge.dir/src/range.cpp.o
03:46:44 /tmp/ws/src/mrpt2/libs/ros2bridge/src/range.cpp: In function ‘bool mrpt::ros2bridge::fromROS(const Range&, mrpt::obs::CObservationRange&)’:
03:46:44 /tmp/ws/src/mrpt2/libs/ros2bridge/src/range.cpp:43:78: error: ‘const Range’ {aka ‘const struct sensor_msgs::msg::Range_<std::allocator<void> >’} has no member named ‘variance’
03:46:44    43 |                 obj.sensedData.at(0).sensorNoiseStdDeviation = std::sqrt(msg.variance);
03:46:44       |                                                                              ^~~~~~~~

I'll investigate it.

from mrpt.

jolting avatar jolting commented on June 18, 2024

This was added on March 15. It didn't make Humble.
ros2/common_interfaces@05d7e19

from mrpt.

jolting avatar jolting commented on June 18, 2024

Maybe try it with declval?

template <class T>
struct has_variance<T, std::void_t<decltype(std::declval<T>().variance)>> : std::true_type
{
};

from mrpt.

jlblancoc avatar jlblancoc commented on June 18, 2024

This was added on March 15. It didn't make Humble. ros2/common_interfaces@05d7e19

Yeap, exactly! :-)

from mrpt.

Related Issues (20)

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.