Update of /cvsroot/playerstage/code/player/client_libs/libplayerc++
In directory
sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25524/client_libs/libplayerc++
Modified Files:
playerc++.h rangerproxy.cc
Log Message:
Changes to ranger interface (moving some properties to messages).
Index: rangerproxy.cc
===================================================================
RCS file:
/cvsroot/playerstage/code/player/client_libs/libplayerc++/rangerproxy.cc,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** rangerproxy.cc 20 May 2007 00:30:14 -0000 1.1
--- rangerproxy.cc 17 Jun 2007 00:28:01 -0000 1.2
***************
*** 111,114 ****
--- 111,130 ----
}
+ void RangerProxy::Configure(double aMinAngle, double aMaxAngle, double
aResolution,
+ double aMaxRange, double aRangeRes, double
aFrequency)
+ {
+ scoped_lock_t lock(mPc->mMutex);
+ if (0 != playerc_ranger_set_config(mDevice, aMinAngle, aMaxAngle,
aResolution,
+ aMaxRange, aRangeRes, aFrequency))
+ throw PlayerError("RangerProxy::Configure()", "error setting config");
+ }
+
+ void RangerProxy::RequestConfigure()
+ {
+ scoped_lock_t lock(mPc->mMutex);
+ if (0 != playerc_ranger_get_config(mDevice, NULL, NULL, NULL, NULL, NULL,
NULL))
+ throw PlayerError("RangerProxy::RequestConfigure()", "error getting
config");
+ }
+
std::ostream& std::operator << (std::ostream &os, const PlayerCc::RangerProxy
&c)
Index: playerc++.h
===================================================================
RCS file:
/cvsroot/playerstage/code/player/client_libs/libplayerc++/playerc++.h,v
retrieving revision 1.87
retrieving revision 1.88
diff -C2 -d -r1.87 -r1.88
*** playerc++.h 20 May 2007 00:30:14 -0000 1.87
--- playerc++.h 17 Jun 2007 00:28:01 -0000 1.88
***************
*** 296,373 ****
// /**
- // The @p AudioDspProxy class controls an @ref interface_audiodsp device.
- //
- // @todo can we make this a subclass of @ref AudioProxy?
- // */
- // class AudioDspProxy : public ClientProxy
- // {
- // private:
- //
- // void Subscribe(uint aIndex);
- // void Unsubscribe();
- //
- // // libplayerc data structure
- // playerc_audiodsp_t *mDevice;
- //
- // public:
- // AudioDspProxy(PlayerClient *aPc, uint aIndex=0);
- // ~AudioDspProxy
- //
- // /** Format code of each sample */
- // uint SetFormat(int aFormat);
- //
- // /** Rate at which to sample (Hz) */
- // uint SetRate(uint aRate);
- //
- // uint GetCount() const { return(GetVar(mDevice->count)); };
- //
- // double GetFrequency(uint aIndex) const
- // { return(GetVar(mDevice->frequency[aIndex])); };
- // double GetAmplitude(uint aIndex) const
- // { return(GetVar(mDevice->amplitude[aIndex])); };
- //
- // void Configure(uint aChan, uint aRate, int16_t aFormat=0xFFFFFFFF);
- //
- // void RequestConfigure();
- //
- // /// Play a fixed-frequency tone
- // void PlayTone(uint aFreq, uint aAmp, uint aDur);
- // void PlayChirp(uint aFreq, uint aAmp, uint aDur,
- // const uint8_t aBitString, uint aBitStringLen);
- // void Replay();
- //
- // /// Print the current data.
- // void Print ();
- // };
-
- // /**
- // The @p AudioMixerProxy class controls an @ref interface_audiomixer device.
- // */
- // class AudioMixerProxy : public ClientProxy
- // {
- // private:
- //
- // void Subscribe(uint aIndex);
- // void Unsubscribe();
- //
- // // libplayerc data structure
- // playerc_audiodsp_t *mDevice;
- //
- // public:
- //
- // AudioMixerProxy (PlayerClient *aPc, uint aIndex=0);
- //
- // void GetConfigure();
- //
- // void SetMaster(uint aLeft, uint aRight);
- // void SetPCM(uint aLeft, uint aRight);
- // void SetLine(uint aLeft, uint aRight);
- // void SetMic(uint aLeft, uint aRight);
- // void SetIGain(uint aGain);
- // void SetOGain(uint aGain);
- //
- // };
-
- // /**
// The @p BlinkenlightProxy class is used to enable and disable
// a flashing indicator light, and to set its period, via a @ref
--- 296,299 ----
***************
*** 2184,2187 ****
--- 2110,2146 ----
/// Request the ranger geometry.
void RequestGeom();
+
+ /// Configure the ranger scan pattern. Angles @p aMinAngle and
+ /// @p aMaxAngle are measured in radians. @p aResolution is measured in
+ /// radians. @p aMaxRange and @p aRangeRes is measured in metres.
+ /// @p aFrequency is measured in Hz.
+ void Configure(double aMinAngle,
+ double aMaxAngle,
+ double aResolution,
+ double aMaxRange,
+ double aRangeRes,
+ double aFrequency);
+
+ /// Get the current ranger configuration; it is read into the
+ /// relevant class attributes.
+ void RequestConfigure();
+
+ /// Start angle of a scan (configured value)
+ double GetMinAngle() const { return GetVar(mDevice->min_angle); };
+
+ /// Stop angle of a scan (configured value)
+ double GetMaxAngle() const { return GetVar(mDevice->max_angle); };
+
+ /// Angular resolution of a scan (configured value)
+ double GetResolution() const { return GetVar(mDevice->resolution); };
+
+ /// Maximum detectable range of a scan (configured value)
+ double GetMaxRange() const { return GetVar(mDevice->max_range); };
+
+ /// Linear resolution (configured value)
+ double GetRangeRes() const { return GetVar(mDevice->range_res); };
+
+ /// Scanning frequency (configured value)
+ double GetFrequency() const { return GetVar(mDevice->frequency); };
};
***************
*** 2257,2261 ****
double& roll, double& pitch, double& yaw, double& time);
! /// Get a simulation property
void GetProperty(char* identifier, char *name, void *value, size_t
value_len );
};
--- 2216,2220 ----
double& roll, double& pitch, double& yaw, double& time);
! /// Get a simulation property
void GetProperty(char* identifier, char *name, void *value, size_t
value_len );
};
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit