Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fixed build errors #19

Closed
wants to merge 1 commit into from

2 participants

@flipback

I have problems similar issues #17, #18. I have found the solve in Internet, and it work. But I newbie in Stage and I'm not sure that this patch will work correctly every time.

Thanks

@rtv
Owner

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

@rtv rtv closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jan 6, 2012
  1. @flipback

    Fixed build errors

    flipback authored
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.