Skip to content

Commit b342ca0

Browse files
authored
Changing NavSatFixPtr to NavSatFix (#104)
1 parent ecf8df8 commit b342ca0

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

gpsd_client/src/client.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -224,23 +224,23 @@ class GPSDClient {
224224
}
225225

226226
void process_data_navsat(struct gps_data_t* p) {
227-
NavSatFixPtr fix(new NavSatFix);
227+
NavSatFix fix;
228228

229229
/* TODO: Support SBAS and other GBAS. */
230230

231231
#if GPSD_API_MAJOR_VERSION >= 9
232232
if (use_gps_time && (p->online.tv_sec || p->online.tv_nsec)) {
233-
fix->header.stamp = ros::Time(p->fix.time.tv_sec, p->fix.time.tv_nsec);
233+
fix.header.stamp = ros::Time(p->fix.time.tv_sec, p->fix.time.tv_nsec);
234234
#else
235235
if (use_gps_time && !std::isnan(p->fix.time)) {
236-
fix->header.stamp = ros::Time(p->fix.time);
236+
fix.header.stamp = ros::Time(p->fix.time);
237237
#endif
238238
}
239239
else {
240-
fix->header.stamp = ros::Time::now();
240+
fix.header.stamp = ros::Time::now();
241241
}
242242

243-
fix->header.frame_id = frame_id;
243+
fix.header.frame_id = frame_id;
244244

245245
/* gpsmm pollutes the global namespace with STATUS_,
246246
* so we need to use the ROS message's integer values
@@ -256,7 +256,7 @@ class GPSDClient {
256256
#else
257257
case STATUS_NO_FIX:
258258
#endif
259-
fix->status.status = 0; // NavSatStatus::STATUS_FIX or NavSatStatus::STATUS_GPS;
259+
fix.status.status = 0; // NavSatStatus::STATUS_FIX or NavSatStatus::STATUS_GPS;
260260
break;
261261
// STATUS_DGPS_FIX was removed in API version 6 but re-added afterward and next renamed since the version 12
262262
#if GPSD_API_MAJOR_VERSION != 6
@@ -265,16 +265,16 @@ class GPSDClient {
265265
#else
266266
case STATUS_DGPS_FIX:
267267
#endif
268-
fix->status.status = 2; // NavSatStatus::STATUS_GBAS_FIX;
268+
fix.status.status = 2; // NavSatStatus::STATUS_GBAS_FIX;
269269
break;
270270
#endif
271271
}
272272

273-
fix->status.service = NavSatStatus::SERVICE_GPS;
273+
fix.status.service = NavSatStatus::SERVICE_GPS;
274274

275-
fix->latitude = p->fix.latitude;
276-
fix->longitude = p->fix.longitude;
277-
fix->altitude = p->fix.altitude;
275+
fix.latitude = p->fix.latitude;
276+
fix.longitude = p->fix.longitude;
277+
fix.altitude = p->fix.altitude;
278278

279279
/* gpsd reports status=OK even when there is no current fix,
280280
* as long as there has been a fix previously. Throw out these
@@ -286,11 +286,11 @@ class GPSDClient {
286286
return;
287287
}
288288

289-
fix->position_covariance[0] = p->fix.epx;
290-
fix->position_covariance[4] = p->fix.epy;
291-
fix->position_covariance[8] = p->fix.epv;
289+
fix.position_covariance[0] = p->fix.epx;
290+
fix.position_covariance[4] = p->fix.epy;
291+
fix.position_covariance[8] = p->fix.epv;
292292

293-
fix->position_covariance_type = NavSatFix::COVARIANCE_TYPE_DIAGONAL_KNOWN;
293+
fix.position_covariance_type = NavSatFix::COVARIANCE_TYPE_DIAGONAL_KNOWN;
294294

295295
navsat_fix_pub.publish(fix);
296296
}

0 commit comments

Comments
 (0)