PX4 Teleop
|
Node for controlling px4 based drone by joystick. More...
#include <cmath>
#include <stdexcept>
#include <string>
#include <vector>
#include <ros/package.h>
#include <ros/ros.h>
#include <sensor_msgs/Joy.h>
#include <geometry_msgs/TwistStamped.h>
#include <geometry_msgs/Vector3.h>
#include <mavros_msgs/CommandBool.h>
#include <mavros_msgs/CommandHome.h>
#include <mavros_msgs/CommandTOL.h>
#include <mavros_msgs/SetMode.h>
#include <mavros_msgs/State.h>
#include <px4_teleop_cmds.hpp>
#include <yaml-cpp/yaml.h>
Go to the source code of this file.
Functions | |
void | state_cb (const mavros_msgs::State::ConstPtr &msg) |
Callback function for state subscriber. More... | |
void | curr_gpos_cb (const sensor_msgs::NavSatFix::ConstPtr &msg) |
Callback function for global position subscriber. More... | |
void | local_pos_cb (const geometry_msgs::PoseStamped::ConstPtr &msg) |
Callback function for local position subscriber. More... | |
void | joy_cb (const sensor_msgs::Joy::ConstPtr &msg) |
Callback function for joystick input subscriber. More... | |
int | main (int argc, char **argv) |
Variables | |
const int | RC_MODE_ONE = 1 |
Rc mode constant. More... | |
const int | RC_MODE_TWO = 2 |
Rc mode constant. More... | |
const std::string | px4_teleop_path = ros::package::getPath("px4_teleop") |
Storage for path of this package. More... | |
mavros_msgs::State | current_state |
Storage for vehicle state. More... | |
sensor_msgs::NavSatFix | curr_gpos |
Storage for current global position. More... | |
geometry_msgs::PoseStamped | local_pos |
Storage for local position. More... | |
sensor_msgs::Joy | joy_msg |
Storage for joystick input. More... | |
Node for controlling px4 based drone by joystick.
Definition in file px4_teleop_joy.cpp.
void curr_gpos_cb | ( | const sensor_msgs::NavSatFix::ConstPtr & | msg | ) |
Callback function for global position subscriber.
msg | Incoming message |
Definition at line 64 of file px4_teleop_joy.cpp.
void joy_cb | ( | const sensor_msgs::Joy::ConstPtr & | msg | ) |
Callback function for joystick input subscriber.
msg | Incoming message |
Definition at line 87 of file px4_teleop_joy.cpp.
void local_pos_cb | ( | const geometry_msgs::PoseStamped::ConstPtr & | msg | ) |
Callback function for local position subscriber.
msg | Incoming message |
Definition at line 76 of file px4_teleop_joy.cpp.
int main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 92 of file px4_teleop_joy.cpp.
void state_cb | ( | const mavros_msgs::State::ConstPtr & | msg | ) |
Callback function for state subscriber.
msg | Incoming message |
Definition at line 52 of file px4_teleop_joy.cpp.
sensor_msgs::NavSatFix curr_gpos |
Storage for current global position.
Definition at line 58 of file px4_teleop_joy.cpp.
mavros_msgs::State current_state |
Storage for vehicle state.
Definition at line 46 of file px4_teleop_joy.cpp.
sensor_msgs::Joy joy_msg |
Storage for joystick input.
Definition at line 82 of file px4_teleop_joy.cpp.
geometry_msgs::PoseStamped local_pos |
Storage for local position.
Definition at line 70 of file px4_teleop_joy.cpp.
const std::string px4_teleop_path = ros::package::getPath("px4_teleop") |
Storage for path of this package.
Definition at line 43 of file px4_teleop_joy.cpp.
const int RC_MODE_ONE = 1 |
Rc mode constant.
Definition at line 38 of file px4_teleop_joy.cpp.
const int RC_MODE_TWO = 2 |
Rc mode constant.
Definition at line 40 of file px4_teleop_joy.cpp.