Coder Social home page Coder Social logo

Comments (6)

clalancette avatar clalancette commented on July 29, 2024 1

phidgets provides a partial piece of code in c that would provide compass direction; but it would have to be rewritten to make it work in ROS - so I was trying to avoid doing that... https://www.phidgets.com/docs/Magnetometer_Primer#Calculating_Heading_from_Magnetometer_Data
(code is at the bottom of the page this link takes you to)

Ah, I see. Yeah, you'll have to write that code to take in the data from ROS and calculate it yourself. There might be some argument for including that as part of the phidgets_spatial package, but I'm not entirely sure if we should do that. @mintar thoughts on that?

from phidgets_drivers.

mintar avatar mintar commented on July 29, 2024 1

Look at this launch file: https://github.com/ros-drivers/phidgets_drivers/blob/melodic/phidgets_imu/launch/imu.launch

That launch file passes the messages from the phidgets driver to the imu_filter_madgwick, which fills out the orientation field in the message. You should pass that message (along with the wheel odometry) to robot_localization, which will fuse the information and publish a odom -> base_link tf transform. Then you'll probably also start amcl localization, which publishes the map -> odom transform. Together they give you the map -> base_link transform, which will be used by move_base or move_base_flex.

The magnetometer is pretty much useless on a wheeled indoor robot though, so I would recommend disabling it and only use the gyro and accelerometer.

from phidgets_drivers.

clalancette avatar clalancette commented on July 29, 2024

Can someone provide a link to the ROS code to get compass orientation from the phidgets spatial (IMU)? I can find the raw magnetometer data (xyz) code but am looking for the compass direction.

Unless I'm misreading the documentation, the libphidgets API doesn't provide this information (and hence, the ROS wrapper here doesn't either). It only provides for the raw magnetometer readings. You could combine the raw magnetometer data with the acceleration data to do it, but I understand it is pretty tricky. If you need this information, an easier solution may be to get an IMU that does these calculations onboard.

from phidgets_drivers.

AllanSchergerGitHub avatar AllanSchergerGitHub commented on July 29, 2024

phidgets provides a partial piece of code in c that would provide compass direction; but it would have to be rewritten to make it work in ROS - so I was trying to avoid doing that... https://www.phidgets.com/docs/Magnetometer_Primer#Calculating_Heading_from_Magnetometer_Data
(code is at the bottom of the page this link takes you to)

from phidgets_drivers.

AllanSchergerGitHub avatar AllanSchergerGitHub commented on July 29, 2024

thanks for checking into this. perhaps an additional (better?) question for me to ask is 'is there a link to a recommended ROS node that should use to bring the phidget magnetometer data into move_base or move_base_flex'?

from phidgets_drivers.

AllanSchergerGitHub avatar AllanSchergerGitHub commented on July 29, 2024

thanks for the great overview! and the links! I'll close this issue and follow up later in a new issue if I have more questions.

from phidgets_drivers.

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.