Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ROS2] there are no estimated orientation #183

Open
NR-Daichi opened this issue May 15, 2024 · 6 comments
Open

[ROS2] there are no estimated orientation #183

NR-Daichi opened this issue May 15, 2024 · 6 comments

Comments

@NR-Daichi
Copy link

NR-Daichi commented May 15, 2024

ros2 launch phidgets_spatial spatial-launch.py

with the above command, it successfully fires up node and publish imu/data_raw, imu/is_calibrated, and imu/mag. However it does not publish imu/data topic. Moreover, it shows the following errors if I set spatial_algorithm as ahrs. So I have to set it as imu.

ros2 launch phidgets_spatial spatial-launch.py 
[INFO] [launch]: All log files can be found below /home/nr_daichi/.ros/log/2024-05-15-15-12-43-587291-ronot-40085
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [component_container-1]: process started with pid [40097]
[component_container-1] [INFO] [1715778763.910926202] [phidget_container]: Load Library: /home/nr_daichi/ros2_ws/install/phidgets_spatial/lib/libphidgets_spatial.so
[component_container-1] [INFO] [1715778763.912989127] [phidget_container]: Found class: rclcpp_components::NodeFactoryTemplate<phidgets::SpatialRosI>
[component_container-1] [INFO] [1715778763.913002177] [phidget_container]: Instantiate class: rclcpp_components::NodeFactoryTemplate<phidgets::SpatialRosI>
[component_container-1] [INFO] [1715778763.914901170] [phidgets_spatial]: Starting Phidgets Spatial
[component_container-1] [INFO] [1715778763.915258380] [phidgets_spatial]: Connecting to Phidgets Spatial serial -1, hub port 0 ...
[component_container-1] [INFO] [1715778763.921194557] [phidgets_spatial]: Connected to serial 532468
[component_container-1] [INFO] [1715778763.922114487] [phidgets_spatial]: Calibrating IMU, this takes around 2 seconds to finish. Make sure that the device is not moved during this time.
[component_container-1] [INFO] [1715778765.922641139] [phidgets_spatial]: Calibrating IMU done.
[component_container-1] [ERROR] [1715778765.923026648] [phidgets_spatial]: Spatial: Failed to set spatial algorithm: Operation Not Supported
[component_container-1] [ERROR] [1715778765.928116129] [phidget_container]: Component constructor threw an exception: Failed to set spatial algorithm: Operation Not Supported
[ERROR] [launch_ros.actions.load_composable_nodes]: Failed to load node 'phidgets_spatial' of type 'phidgets::SpatialRosI' in container '/phidget_container': Component constructor threw an exception: Failed to set spatial algorithm: Operation Not Supported

But with ununtu 20.04, it publishes topic imu/data and it has estimated orientation

@mintar
Copy link
Contributor

mintar commented May 15, 2024 via email

@mintar
Copy link
Contributor

mintar commented May 15, 2024 via email

@mintar
Copy link
Contributor

mintar commented May 15, 2024 via email

@NR-Daichi
Copy link
Author

NR-Daichi commented May 17, 2024

It's my apologizes that I omitted information. The followings are my set up:

IMU: PhidgetSpatial 3/3/3 Basic 1042_0
ROS2: Humble with Ubuntu 22.04 + humble branch of this rep (https://github.com/ros-drivers/phidgets_drivers/tree/humble)
ROS1: Noetic with Ubuntu 20.04 + noetic branch of this rep

Additionally, I installed it from source because the one I installed from package did not work. Is there any possibility that I am missing some dependencies?

@mintar
Copy link
Contributor

mintar commented May 18, 2024

Your device (PhidgetSpatial 3/3/3 Basic 1042_0) doesn't support onboard orientation estimation. You can see that if you check the C API: https://www.phidgets.com/?prodid=1025#Tab_API

For your device, PhidgetSpatial_getAlgorithm() has a constant output of Constant: SPATIAL_ALGORITHM_NONE, and the function PhidgetSpatial_setAlgorithm() is missing. Compare that to the PhidgetSpatial Precision 3/3/3 MOT0110_0, which has that function: https://www.phidgets.com/?prodid=1205#Tab_API

This explains the error message that you're getting:

[component_container-1] [ERROR] [1715778765.923026648] [phidgets_spatial]: Spatial: Failed to set spatial algorithm: Operation Not Supported

However, you can still use your device! On ROS1 Noetic it works because it doesn't use the onboard orientation estimation. Instead it uses imu_filter_madgwick to estimate the orientation.

You can do the same on ROS2: https://github.com/CCNYRoboticsLab/imu_tools/tree/humble

@NR-Daichi
Copy link
Author

Thank you for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants