Git Product home page Git Product logo

duro_gps_driver's People

Contributors

csaplaci avatar horverno avatar rokusottervanger avatar rudolfkrecht avatar szepilot avatar umiklos avatar willcbaker avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

duro_gps_driver's Issues

Missing License

No license information available in this project, can you add an open source license (such as MIT or Apache)?

ROS2 process has died (only at the end)

Not an urgent issue. After stopping the ros2 node, following error shows up:

[ERROR] [duro_node-1]: process has died [pid 42717, exit code -11, cmd '/home/dev/ros2_ws/install/duro_gps_driver/lib/duro_gps_driver/duro_node --ros-args --params-file /tmp/launch_params_x_50soe5 --params-file /tmp/launch_params_jr4meyrh --params-file /tmp/launch_params_eulraqmu --params-file /tmp/launch_params_xyxbhqmq --params-file /tmp/launch_params_w_v8zclu --params-file /tmp/launch_params_8n_tp44w --params-file /tmp/launch_params_4mpronji --params-file /tmp/launch_params_l565il6v --params-file /tmp/launch_params_n6xk85ff'].

Test before new release

Couple of things to check before a non-beta release:

  • Is the provided documentation enough
  • Are there any performance issues
  • Whether the example rosbag ok, and the current way of sharing ok
  • Any typos or other problems
    @rudolfkrecht @rokusottervanger
    Thanks ๐Ÿ‘

TF publisher

A ROS/ROS2 tf2 broadcaster for transforms. Send out the relative pose of coordinate frames to the rest of the system.
The parameters should be the following:

  • tf_publish - Boolean
  • tf_pub_child_frame_id - String
  • tf_pub_frame_id - String

The transform (translation + rotation) should be the same values as current_pose pose (position + orientation)

Time reference to sec + nsec

Swiftnaw provides GPS time in msec + nsec_residual basis, but the standard ROS time is sec + nsec. Conversion is needed.

https://swift-nav.github.io/libsbp/c/build/docs/html/structsbp__gps__time__t.html

time_msg->time_ref.sec = time_gps.tow; // TODO - It is not sec: GPS time of week rounded to the nearest millisecond [ms]
time_msg->time_ref.nsec = time_gps.ns_residual; // TODO - It is not nsec: Nanosecond residual of millisecond-rounded TOW

time_msg->time_ref.sec = time_gps.tow; // TODO - It is not sec: GPS time of week rounded to the nearest millisecond [ms]

pose_cov_msg.pose.covariance calculated value

pose_cov_msg.pose.pose = pose_msg.pose;
pose_cov_msg.header = pose_msg.header;
pose_cov_msg.pose.covariance[0] = 0.01;
pose_cov_msg.pose.covariance[7] = 0.01;
pose_cov_msg.pose.covariance[14] = 0.01;
pose_cov_msg.pose.covariance[21] = 0.01;
pose_cov_msg.pose.covariance[28] = 0.01;
pose_cov_msg.pose.covariance[35] = 0.01;

// covariance matrix
double h_covariance = pow(latlonmsg->h_accuracy * 1e-3, 2); // Convert mm to m and take the ^2 for going from std to cov
double v_covariance = pow(latlonmsg->v_accuracy * 1e-3, 2); // Convert mm to m and take the ^2 for going from std to cov
navsatfix_msg.position_covariance[0] = h_covariance; // x = 0, 0
navsatfix_msg.position_covariance[4] = h_covariance; // y = 1, 1
navsatfix_msg.position_covariance[8] = v_covariance; // z = 2, 2
navsatfix_msg.position_covariance_type = sensor_msgs::msg::NavSatFix::COVARIANCE_TYPE_DIAGONAL_KNOWN;

Orientation Incorrect on GPS Duro

On my GPS we are getting West North Up orientation (which does not match the standard right hand or left hand ) with inverted rotation instead of the ROS standard East North Up.

In code it may be related to the code here:

void orientation_callback(u16 sender_id, u8 len, u8 msg[], void *context)
{
// enable MSG ID 544 in swift console
// the MSG ID comes from eg #define SBP_MSG_ORIENT_QUAT 0x0220 --> 544
msg_orient_quat_t *orimsg = (msg_orient_quat_t *)msg;
double w = orimsg->w * pow(2, -31);
double x = orimsg->x * pow(2, -31);
double y = orimsg->y * pow(2, -31);
double z = orimsg->z * pow(2, -31);
tf2::Quaternion tf_orig(x, y, z, w);
tf2::Quaternion tf_rot, tf_aligned;
tf_rot.setRPY(0.0, 0.0, -M_PI_2); // left-handerd / right handed rotation
tf_aligned = tf_rot * tf_orig; // left-handerd / right handed rotation
pose_msg.pose.orientation.w = tf_aligned.w() * -1;
pose_msg.pose.orientation.x = tf_aligned.y(); // left-handerd / right handed orientation
pose_msg.pose.orientation.y = tf_aligned.x() * -1; // left-handerd / right handed orientation
pose_msg.pose.orientation.z = tf_aligned.z(); // left-handerd / right handed orientation
}

More specifically this code block:

pose_msg.pose.orientation.w = tf_aligned.w() * -1;
pose_msg.pose.orientation.x = tf_aligned.y();      // left-handerd / right handed orientation
pose_msg.pose.orientation.y = tf_aligned.x() * -1; // left-handerd / right handed orientation
pose_msg.pose.orientation.z = tf_aligned.z();      // left-handerd / right handed orientation

which inverts w and x and causes inverted rotation and West to be the X axis instead of ROS standard East.

Could we get a param to switch this behavior to keep current behavior possible set to true?

Add "fake" orientation for non-inertial GPS-es

Although Duro Inertial and Piksi Multi Inertial provides orientation, Duro and Piksi Multi does not. The initial idea is to use history position data to artificially generate orientation. The limitation is obvious, the orientation accuracy is lower and it only works when moving and the precision is high (FIXED_RTK or FLOAT_RTK).

Update ROS 2 time_callback acccording to ROS 1

void time_callback(u16 sender_id, u8 len, u8 msg[], void *context)
{
msg_gps_time_t *time_gps = (msg_gps_time_t *)msg;
sensor_msgs::TimeReference time_msg;
time_msg.header.frame_id = "ros_time";
//time_msg.header.stamp.nsec = ros::Time::now().nsec / 1000;
//time_msg.header.stamp.sec = ros::Time::now().sec;
time_msg.header.stamp = ros::Time::now();
//rounded msec + residual nsec -> truncated sec + remainder nsec
long long int towtemp = time_gps->tow % 1000;
long long int ttemp = (towtemp * 1000000 + time_gps->ns_residual) % 1000000000;
time_msg.time_ref.nsec = ttemp;
time_msg.time_ref.sec = time_gps->tow / 1000 + time_gps->wn * 604800 + 315964782;
time_msg.source = "gps_duro";
std_msgs::Float64 diff_msg;
ros::Duration diff = time_msg.time_ref - time_msg.header.stamp;
diff_msg.data = diff.toSec();
//diff_msg.data = time_gps->tow;
std_msgs::String gps_str_msg;
gps_str_msg.data = std::to_string(time_gps->wn) + " " + std::to_string(time_gps->tow) + " " + std::to_string(time_gps->ns_residual);
time_gps_str_pub.publish(gps_str_msg);
time_ref_pub.publish(time_msg);
time_diff_pub.publish(diff_msg);
}

void time_callback(u16 sender_id, u8 len, u8 msg[], void *context)
{
msg_gps_time_t *time_gps = (msg_gps_time_t *)msg;
time_ref_msg.header.frame_id = "ros_time_frame";
time_ref_msg.header.stamp = node->now();
//rounded msec + residual nsec -> truncated sec + remainder nsec
long long int towtemp = time_gps->tow % 1000;
long long int ttemp = (towtemp * 1000000 + time_gps->ns_residual) % 1000000000;
time_ref_msg.time_ref.nanosec = ttemp;
time_ref_msg.time_ref.sec = time_gps->tow / 1000;
time_ref_msg.source = "gps_duro";
time_ref_pub->publish(time_ref_msg);
}

Let a driver be a driver: UTM conversion should be separate functionality

There is now a conversion from lat long to UTM coordinates in this driver. IMHO I think you should let the driver be a driver, and perform UTM conversion separately and independently if necessary. Just use the regular ROS message types like sensor_msgs/NavSatFix and you'll be able to swap devices without the need to implement a new driver that performs UTM conversion like this one. It makes for a more flexible and lean system.

For example, for my use case, I don't need UTM conversion, but using this driver forces me to take on the extra weight of the UTM conversion for no reason.

Code does not follow ROS design conventions

This node does not follow the conventions and rules about:

Also, it's good practice to separate a library for interfacing with the hardware from the ROS wrapper, implemented as a C++ class.

Would you be interested in a refactor to make your driver follow these conventions? It might break existing setups, but as there is no release yet, that doesn't seem like too much of a problem.

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.