mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-18 03:53:33 +08:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user