Skip to content

Commit

Permalink
Merge pull request #1276 from fspindle/fix_various
Browse files Browse the repository at this point in the history
Fix various
  • Loading branch information
fspindle authored Nov 17, 2023
2 parents 50d573e + 39f501c commit 4ff4049
Show file tree
Hide file tree
Showing 31 changed files with 419 additions and 422 deletions.
1 change: 1 addition & 0 deletions 3rdparty/pololu/src/RPMSerialInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ RPMSerialInterface *RPMSerialInterface::createSerialInterface(const std::string
serialInterface = new RPMSerialInterfaceWindows(portName, baudRate, errorMessage);
#else
serialInterface = new RPMSerialInterfacePOSIX(portName, errorMessage);
(void)baudRate;
#endif

// If the interface couldn't be open properly, delete it
Expand Down
13 changes: 9 additions & 4 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,21 @@

ViSP 3.x.x (Version in development)
- Contributors:
. Fabien Spindler, Florent Lamiraux
. Fabien Spindler, Romain Lagneau, Pierre Perraud, Florent Lamiraux, Samuel Felton, François Chaumette,
Souriya Trinh
- New classes
.
- Deprecated removed
. vpPlanarObjectDetector, vpFernClassifier classes are removed
. vpPololu and vpRobotPololuPtu to control respectively a servo motor using a pololu maestro board or a 3D printed
2 dof pan-tilt unit. Visual servoing example provided in example/servo-pololu-ptu. Tests available in
modules/robot/test/servo-pololu/
- Deprecated
. vpPlanarObjectDetector, vpFernClassifier deprecated classes are removed
. End of supporting c++98 standard. As a consequence, ViSP is no more compatible with Ubuntu 12.04
. vpDisplay::displayCharString() is marked deprecated. Use vpDisplay::displayText() instead
- New features and improvements
. Introduce applications in apps folder, a collection of useful tools that
have a dependency to the install target
. Bump minimal c++ standard to c++11
. Speed up build by including only opencv2/opencv_modules.hpp instead of opencv2/opencv.hpp header in vpConfig.h
- Applications
. Migrate eye-to-hand tutorials in apps
- Tutorials
Expand Down
119 changes: 59 additions & 60 deletions modules/core/include/visp3/core/vpMoment.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,71 +49,70 @@ class vpMomentDatabase;
class vpMomentObject;

/*!
\class vpMoment
\ingroup group_core_moments
\brief This class defines shared methods/attributes for 2D moments.
All moments or combination of moments in the moments module are based on
this class. A moment uses a vpMomentObject object to access all useful
information. Moment values are obtained by a 4-step process common for all
moment types:
- Declaration.
\code
vpMoment moment;
\endcode
- Update with object.
\code
moment.update(object);
\endcode
- Compute the moment value
\code
moment.compute();
\endcode
- Access the values:
\code
std::vector<double> values = moment.get();
\endcode
A moment may also be linked to a vpMomentDatabase. Moments linked to a
database are able to access each others values. Some moments can be computed
only if they are linked to a a database containing their dependencies.
Linking to a database is done using the vpMoment::linkTo(...) method.
There are no constraints about format of the array returned by
vpMoment::get(); any implementation is fine.
Each moment must have a string name by implementing the char*
vpMoment::name() method which allows to identify the moment in the database.
Each moment must also implement a compute method describing how to obtain
its values from the object.
\attention Order of moment computation DOES matter: when you compute a
moment using vpMoment::compute(), all moment dependencies must be computed.
We recall that implemented moments are:
- vpMomentAlpha
- vpMomentArea
- vpMomentAreaNormalized
- vpMomentBasic
- vpMomentCentered
- vpMomentCInvariant
- vpMomentGravityCenter
- vpMomentGravityCenterNormalized
*/
* \class vpMoment
*
* \ingroup group_core_moments
*
* \brief This class defines shared methods/attributes for 2D moments.
*
* All moments or combination of moments in the moments module are based on
* this class. A moment uses a vpMomentObject object to access all useful
* information. Moment values are obtained by a 4-step process common for all
* moment types:
* - Declaration.
* \code
* vpMoment moment;
* \endcode
* - Update with object.
* \code
* moment.update(object);
* \endcode
* - Compute the moment value
* \code
* moment.compute();
* \endcode
* - Access the values:
* \code
* std::vector<double> values = moment.get();
* \endcode
*
* A moment may also be linked to a vpMomentDatabase. Moments linked to a
* database are able to access each others values. Some moments can be computed
* only if they are linked to a a database containing their dependencies.
* Linking to a database is done using the vpMoment::linkTo(...) method.
*
* There are no constraints about format of the array returned by
* vpMoment::get(); any implementation is fine.
*
* Each moment must have a string name by implementing the char*
* vpMoment::name() method which allows to identify the moment in the database.
* Each moment must also implement a compute method describing how to obtain
* its values from the object.
*
* \attention Order of moment computation DOES matter: when you compute a
* moment using vpMoment::compute(), all moment dependencies must be computed.
* We recall that implemented moments are:
* - vpMomentAlpha
* - vpMomentArea
* - vpMomentAreaNormalized
* - vpMomentBasic
* - vpMomentCentered
* - vpMomentCInvariant
* - vpMomentGravityCenter
* - vpMomentGravityCenterNormalized
*/
class VISP_EXPORT vpMoment
{
private:
vpMomentObject *object;
vpMomentDatabase *moments;
char _name[255];
std::string m_name;

protected:
std::vector<double> values;
/*!
Returns the linked moment database.
\return the moment database
* Returns the linked moment database.
* \return the moment database
*/
inline vpMomentDatabase &getMoments() const { return *moments; }

Expand All @@ -137,19 +136,19 @@ class VISP_EXPORT vpMoment
/*!
Virtual destructor.
*/
virtual ~vpMoment() {}
virtual ~vpMoment() { }

/** @name Inherited functionalities from vpMoment */
//@{
virtual void compute() = 0;
inline const vpMomentObject &getObject() const { return *object; }
/*!
Returns all values computed by the moment.
\return vector of values
* Returns all values computed by the moment.
* \return vector of values
*/
const std::vector<double> &get() const { return values; }
void linkTo(vpMomentDatabase &moments);
virtual const char *name() const = 0;
virtual const std::string name() const = 0;
virtual void printDependencies(std::ostream &os) const;
void update(vpMomentObject &object);
//@}
Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/visp3/core/vpMomentAlpha.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ class VISP_EXPORT vpMomentAlpha : public vpMoment
/*!
* Moment name.
*/
const char *name() const { return "vpMomentAlpha"; }
const std::string name() const { return "vpMomentAlpha"; }

/*!
* Returns true if the alpha moment was constructed as a reference with values in \f$ [-\pi/2 ; \pi/2] \f$, false
Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/visp3/core/vpMomentArea.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ class VISP_EXPORT vpMomentArea : public vpMoment
//@{
void compute();
//! Moment name.
const char *name() const { return "vpMomentArea"; }
const std::string name() const { return "vpMomentArea"; }
void printDependencies(std::ostream &os) const;
//@}
friend VISP_EXPORT std::ostream &operator<<(std::ostream &os, const vpMomentArea &m);
Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/visp3/core/vpMomentAreaNormalized.h
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ class VISP_EXPORT vpMomentAreaNormalized : public vpMoment
/*!
* Moment name.
*/
const char *name() const { return "vpMomentAreaNormalized"; }
const std::string name() const { return "vpMomentAreaNormalized"; }
friend VISP_EXPORT std::ostream &operator<<(std::ostream &os, const vpMomentAreaNormalized &v);
void printDependencies(std::ostream &os) const;
};
Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/visp3/core/vpMomentBasic.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class VISP_EXPORT vpMomentBasic : public vpMoment
/*!
Moment name.
*/
const char *name() const { return "vpMomentBasic"; }
const std::string name() const { return "vpMomentBasic"; }
friend VISP_EXPORT std::ostream &operator<<(std::ostream &os, const vpMomentBasic &v);
void printDependencies(std::ostream &os) const;
};
Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/visp3/core/vpMomentCInvariant.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ class VISP_EXPORT vpMomentCInvariant : public vpMoment
/*!
Moment name.
*/
const char *name() const { return "vpMomentCInvariant"; }
const std::string name() const { return "vpMomentCInvariant"; }

/*!
Print partial invariant.
Expand Down
2 changes: 1 addition & 1 deletion modules/core/include/visp3/core/vpMomentCentered.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ class VISP_EXPORT vpMomentCentered : public vpMoment
/*!
Moment name.
*/
inline const char *name() const { return "vpMomentCentered"; }
inline const std::string name() const { return "vpMomentCentered"; }

friend VISP_EXPORT std::ostream &operator<<(std::ostream &os, const vpMomentCentered &v);
void printWithIndices(std::ostream &os) const;
Expand Down
Loading

0 comments on commit 4ff4049

Please sign in to comment.