ROS: Fixes for ROS build

The ROS build included some files that used isfinite vs PX4_ISFINITE.

The AppState class also needed to be supported for ROS.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2015-05-19 10:41:15 -07:00
parent 49a200d834
commit 0f5cb75692
6 changed files with 25 additions and 20 deletions
+2
View File
@@ -66,6 +66,8 @@
/* Get value of parameter by name, which is equal to the handle for ros */
#define PX4_PARAM_GET_BYNAME(_name, _destpt) ros::param::get(_name, *_destpt)
#define PX4_ISFINITE(x) std::isfinite(x)
#elif defined(__PX4_NUTTX) || defined(__PX4_POSIX)
/*
* Building for NuttX or POSIX
+6 -3
View File
@@ -42,7 +42,6 @@
#include "px4_subscriber.h"
#include "px4_publisher.h"
#include "px4_middleware.h"
#include "px4_posix.h"
#include "px4_app.h"
#if defined(__PX4_ROS)
@@ -64,10 +63,11 @@ class NodeHandle :
private ros::NodeHandle
{
public:
NodeHandle() :
NodeHandle(AppState &a) :
ros::NodeHandle(),
_subs(),
_pubs()
_pubs(),
_appState(a)
{}
~NodeHandle()
@@ -138,6 +138,9 @@ public:
protected:
std::list<SubscriberBase *> _subs; /**< Subcriptions of node */
std::list<PublisherBase *> _pubs; /**< Publications of node */
AppState &_appState;
};
#else //Building for NuttX
class __EXPORT NodeHandle
+4 -4
View File
@@ -55,7 +55,7 @@
__EXPORT float _wrap_pi(float bearing)
{
/* value is inf or NaN */
if (!isfinite(bearing)) {
if (!PX4_ISFINITE(bearing)) {
return bearing;
}
@@ -85,7 +85,7 @@ __EXPORT float _wrap_pi(float bearing)
__EXPORT float _wrap_2pi(float bearing)
{
/* value is inf or NaN */
if (!isfinite(bearing)) {
if (!PX4_ISFINITE(bearing)) {
return bearing;
}
@@ -115,7 +115,7 @@ __EXPORT float _wrap_2pi(float bearing)
__EXPORT float _wrap_180(float bearing)
{
/* value is inf or NaN */
if (!isfinite(bearing)) {
if (!PX4_ISFINITE(bearing)) {
return bearing;
}
@@ -145,7 +145,7 @@ __EXPORT float _wrap_180(float bearing)
__EXPORT float _wrap_360(float bearing)
{
/* value is inf or NaN */
if (!isfinite(bearing)) {
if (!PX4_ISFINITE(bearing)) {
return bearing;
}