ros-drivers / phidgets_drivers

ROS drivers for various Phidgets devices
Other
45 stars 61 forks source link

Location affect to the orientation #167

Open ammarazab1 opened 1 year ago

ammarazab1 commented 1 year ago

I faced an issue with MOT0110_0 phidgetSpatial 3/3/3 that I connect it to my laptop or jetson and put it above the tableat specific point the IMU is equal to initial odom orientation when close spatial node and move the spatial to anther place in same table the orientaion is changed How that be happen?

I make some tiny edit in the launch file.

<!-- Phidgets Spatial launch file -->

<launch>

  #### Nodelet manager ######################################################

  <node pkg="nodelet" type="nodelet" name="imu_manager"
    args="manager" output="screen" />

  #### Spatial Driver #######################################################

  <node pkg="nodelet" type="nodelet" name="PhidgetsSpatialNodelet"
    args="load phidgets_spatial/PhidgetsSpatialNodelet imu_manager"
    output="screen">

    # See README.md for more information on the parameters

    # optional param serial, default is -1
    <!-- <param name="serial" value="123456"/> -->

    # optional param hub_port, used if connected to a VINT hub
    <!-- <param name="hub_port" value="0"/> -->

    # optional param frame_id, default is "imu_link"
    <!-- <param name="frame_id" value="imu_link"/> -->

    # optional param use_orientation, default is false
    <!-- <param name="use_orientation" value="false"/> -->

    # optional param spatial_algorithm, default is "ahrs"
     <param name="spatial_algorithm" value="imu"/> 

    # optional ahrs parameters
    <!-- <param name="ahrs_angular_velocity_threshold" value="1.0"/>
         <param name="ahrs_angular_velocity_delta_threshold" value="0.1"/>
         <param name="ahrs_acceleration_threshold" value="0.1"/>
         <param name="ahrs_mag_time" value="10.0"/>
         <param name="ahrs_accel_time" value="10.0"/>
         <param name="ahrs_bias_time" value="1.25"/> -->

    # optional param algorithm_magnetometer_gain, default is 0.005
    <param name="algorithm_magnetometer_gain" value="0.005"/>

    # optional param heating_enabled, not modified by default
    <!-- <param name="heating_enabled" value="false"/> -->

    # optional param linear_acceleration_stdev, default is 280ug
    <param name="linear_acceleration_stdev" value="0.002745862"/>

    # optional param angular_velocity_stdev, default is 0.095 deg/s
    <param name="angular_velocity_stdev" value="0.000349" />

    # optional param magnetic_field_stdev, default is 1.1 milligauss
    <!-- <param name="magnetic_field_stdev" type="double" value="1.1e-7" /> -->

    # supported data rates: 4 8 16 24 32 40 ... 1000 (in ms)
    <param name="data_interval_ms" value="4"/>

    # optional param publish_rate, defaults to 0
    <!-- <param name="publish_rate" value="0" /> -->

    # optional param server_name, required to locate remote network servers
    <!-- <param name="server_name" value="myPhidgetServer" /> -->

    # optional param server_ip, required to locate remote network servers
    <!-- <param name="server_ip" value="0.0.0.0" /> -->

    # compass correction params (see http://www.phidgets.com/docs/1044_User_Guide)
    <param name="cc_mag_field" value="0.52859"/>
         <param name="cc_offset0" value="0.03921"/>
         <param name="cc_offset1" value="0.19441"/>
         <param name="cc_offset2" value="-0.03493"/>
         <param name="cc_gain0" value="1.81704"/>
         <param name="cc_gain1" value="1.81028"/>
         <param name="cc_gain2" value="2.04819"/>
         <param name="cc_t0" value="0.00142"/>
         <param name="cc_t1" value="-0.03591"/>
         <param name="cc_t2" value="0.00160 "/>
         <param name="cc_t3" value="-0.05038"/>
         <param name="cc_t4" value="-0.03942"/>
         <param name="cc_t5" value="-0.05673"/>
  </node>

  #### IMU Orientation Filter ###############################################

  <node pkg="nodelet" type="nodelet" name="ImuFilterNodelet"
    args="load imu_filter_madgwick/ImuFilterNodelet imu_manager"
    output="screen">

    <param name="use_mag" value="false"/>
    <param name="reverse_tf" value="false" />
  </node>

</launch>

and this is s photo from point number one

Screenshot from 2023-08-28 11-41-59

and this is at point number two

Screenshot from 2023-08-28 11-43-55

Thanks in Advance