Skip to content
Browse files

Fixed build errors

  • Loading branch information...
1 parent f139bda commit 9f11d05d08134a1e56bf4ebc2957f2a3de7cdbc4 @flipback committed
Showing with 20 additions and 4 deletions.
  1. +2 −2 libstageplugin/p_driver.h
  2. +18 −2 libstageplugin/p_ranger.cc
View
4 libstageplugin/p_driver.h
@@ -108,8 +108,8 @@ class InterfaceModel
virtual void Subscribe( void );
virtual void Unsubscribe( void );
- virtual void Subscribe( QueuePointer &queue );
- virtual void Unsubscribe( QueuePointer &queue );
+ virtual void Subscribe( QueuePointer &queue ) {}
+ virtual void Unsubscribe( QueuePointer &queue ) {}
protected:
Stg::Model* mod;
View
20 libstageplugin/p_ranger.cc
@@ -70,8 +70,24 @@ void InterfaceRanger::Publish( void )
if( sensors.size() == 1 ) // a laser scanner type, with one beam origin and many ranges
{
- prange.ranges = rgr->GetRangesArr( 0, &prange.ranges_count );
- pintens.intensities = rgr->GetIntensitiesArr( 0, &pintens.intensities_count );
+ std::vector<meters_t> ranges = sensors[0].ranges;
+ std::vector<double> intensities = sensors[0].intensities;
+ prange.ranges_count = ranges.size();
+ if (ranges.size() > 0)
+ {
+ prange.ranges = new double[ranges.size()];
+ for (int i=0; i < ranges.size(); i++)
+ prange.ranges[i] = ranges[i];
+ }
+
+ if (intensities.size() > 0)
+ {
+ pintens.intensities_count = intensities.size();
+ pintens.intensities = new double[intensities.size()];
+ for (int i=0; i < intensities.size(); i++)
+ pintens.intensities[i] = intensities[i];
+ }
+
}
else
{ // a sonar/IR type with one range per beam origin

1 comment on commit 9f11d05

@rtv

Thanks for the patch. I've fixed the bug in a more compact way in git master.

Please sign in to comment.
Something went wrong with that request. Please try again.