diff options
Diffstat (limited to 'src/platforms')
-rw-r--r-- | src/platforms/px4_message.h | 6 | ||||
-rw-r--r-- | src/platforms/ros/nodes/commander/commander.h | 6 | ||||
-rw-r--r-- | src/platforms/ros/nodes/position_estimator/position_estimator.cpp | 4 |
3 files changed, 9 insertions, 7 deletions
diff --git a/src/platforms/px4_message.h b/src/platforms/px4_message.h index bff7aa313..499a5dd8b 100644 --- a/src/platforms/px4_message.h +++ b/src/platforms/px4_message.h @@ -39,7 +39,7 @@ #pragma once #if defined(__PX4_ROS) -typedef const char* PX4TopicHandle; +typedef const char *PX4TopicHandle; #else #include <uORB/uORB.h> typedef orb_id_t PX4TopicHandle; @@ -68,8 +68,8 @@ public: virtual ~PX4Message() {}; - virtual M& data() {return _data;} - virtual const M& data() const {return _data;} + virtual M &data() {return _data;} + virtual const M &data() const {return _data;} private: M _data; }; diff --git a/src/platforms/ros/nodes/commander/commander.h b/src/platforms/ros/nodes/commander/commander.h index c537c8419..fc88260ba 100644 --- a/src/platforms/ros/nodes/commander/commander.h +++ b/src/platforms/ros/nodes/commander/commander.h @@ -68,14 +68,14 @@ protected: * Set control mode flags based on stick positions (equiv to code in px4 commander) */ void EvalSwitches(const px4::manual_control_setpointConstPtr &msg, - px4::vehicle_status &msg_vehicle_status, - px4::vehicle_control_mode &msg_vehicle_control_mode); + px4::vehicle_status &msg_vehicle_status, + px4::vehicle_control_mode &msg_vehicle_control_mode); /** * Sets offboard controll flags in msg_vehicle_control_mode */ void SetOffboardControl(const px4::offboard_control_mode &msg_offboard_control_mode, - px4::vehicle_control_mode &msg_vehicle_control_mode); + px4::vehicle_control_mode &msg_vehicle_control_mode); ros::NodeHandle _n; ros::Subscriber _man_ctrl_sp_sub; diff --git a/src/platforms/ros/nodes/position_estimator/position_estimator.cpp b/src/platforms/ros/nodes/position_estimator/position_estimator.cpp index ed3a4efa5..e4273687e 100644 --- a/src/platforms/ros/nodes/position_estimator/position_estimator.cpp +++ b/src/platforms/ros/nodes/position_estimator/position_estimator.cpp @@ -64,14 +64,16 @@ void PositionEstimator::ModelStatesCallback(const gazebo_msgs::ModelStatesConstP /* Fill px4 position topic with contents from modelstates topic */ int index = 0; + //XXX: maybe a more clever approach would be to do this not on every loop, need to check if and when //gazebo rearranges indexes. - for(std::vector<std::string>::const_iterator it = msg->name.begin(); it != msg->name.end(); ++it) { + for (std::vector<std::string>::const_iterator it = msg->name.begin(); it != msg->name.end(); ++it) { if (*it == "iris" || *it == "ardrone") { index = it - msg->name.begin(); break; } } + msg_v_l_pos.xy_valid = true; msg_v_l_pos.z_valid = true; msg_v_l_pos.v_xy_valid = true; |