Difference Between Velocity Vectors

Issue #10 resolved
Former user created an issue

Hi, I'm trying to understand the difference between how the following two messages are calculated:

gps/vel/twist/linear.x gps/odom/twist/linear.x

The values are slightly different, and I'm wondering how they are found. I'm also wondering what are the units associated with these fields?

Comments (7)

  1. Kevin Hallenbeck

    The units are meters per second (m/s) to comply with REP 103

    Based on the code, the x/y/z values should be the same, however, the odometery messages has an extra frame_id:

    geometry_msgs::TwistWithCovarianceStamped msg_vel;
    msg_vel.header.stamp = stamp;
    msg_vel.header.frame_id = frame_id_vel;
    msg_vel.twist.twist.linear.x = (double)packet->vel_east * 1e-4;
    msg_vel.twist.twist.linear.y = (double)packet->vel_north * 1e-4;
    msg_vel.twist.twist.linear.z = (double)packet->vel_down * -1e-4;
    
    nav_msgs::Odometry msg_odom;
    msg_odom.header.stamp = stamp;
    msg_odom.header.frame_id = frame_id_vel;
    msg_odom.child_frame_id = "base_link";
    msg_odom.twist = msg_vel.twist;
    

    It looks like the nav_msg/Odometry message should be in local child_frame_id, but it is also in the global frame_id. This is a mistake.

    I do not plan on changing the odometry message because I don't know how many users would be affected. Furthermore, I don't have an Oxford GPS to test with.

  2. Luke Armbruster

    Thanks. One more question. Regarding the uint16_t time in dispatch.h, is this value at the time of measurement for the Oxford GPS? If so, what is the time relative to and is there a more accurate value that I can get regarding the actual time the measurement was recorded?

  3. Kevin Hallenbeck

    Everything in dispatch.h is straight out of ncomman.pdf.

    From page 6: Time is transmitted as milliseconds into the minute in GPS time. Range is 0 to 59,999 ms

    From page 13: Time in minutes since GPS began (midnight 06/01/1980)

    When a packet with channel 0 is received, those two values could be combined to get the full GPS time and publish a sensor_msgs/TimeReference.

    I have no plans to implement this, but pull-requests are welcome.

  4. Luke Armbruster

    Can you also tell me what I have to do if I'm interested in getting fields from channels that are not defined in Packet from dispatch.h? i.e. I am trying to get the UTC time offset from channel 16.

  5. Luke Armbruster

    It looks to me like I would need to add the struct definition to dispatch.h, add another case to switch(packet->channel) in node.cpp

  6. Kevin Hallenbeck

    That's exactly right. Add another structure to the union in in dispatch.h, and add another case to the switch in node.cpp

  7. Log in to comment