Skip to content

Commit

Permalink
Run clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
abrandemuehl committed Apr 21, 2018
1 parent a0a1248 commit 4e58bf8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/constructors/Quaternion.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ inline geometry_msgs::Quaternion Quaternion(double x, double y, double z,
}

inline geometry_msgs::Quaternion QuaternionRPY(double roll, double pitch,
double yaw) {
double yaw) {
tf::Quaternion quat;
quat.setEuler(yaw, pitch, roll);

Expand Down
11 changes: 4 additions & 7 deletions src/motion/motion_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,9 @@ void MotionController::Start() {
nh_.createTimer(ros::Duration(kPeriod), &MotionController::Update, this);

// Start subscribers
pose_sub_ =
nh_.subscribe("/cmd_pos", 1, &MotionController::SetPose, this);
twist_sub_ =
nh_.subscribe("/cmd_vel", 1, &MotionController::SetTwist, this);
kill_sub_ =
nh_.subscribe("/arming", 1, &MotionController::Arming, this);
pose_sub_ = nh_.subscribe("/cmd_pos", 1, &MotionController::SetPose, this);
twist_sub_ = nh_.subscribe("/cmd_vel", 1, &MotionController::SetTwist, this);
kill_sub_ = nh_.subscribe("/arming", 1, &MotionController::Arming, this);
}

void MotionController::SetPose(const geometry_msgs::PoseStamped pos) {
Expand All @@ -44,7 +41,7 @@ void MotionController::SetTwist(const geometry_msgs::TwistStamped vel) {

// Set a timeout for 1 second
vel_timer_ = nh_.createTimer(ros::Duration(1.0),
&MotionController::VelocityTimeout, this, true);
&MotionController::VelocityTimeout, this, true);
}

void MotionController::Arming(const std_msgs::Bool arm) { DoArming(arm.data); }
Expand Down
12 changes: 7 additions & 5 deletions src/motion/rcmavros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ const std::string kArmingService = "/mavros/cmd/arming";

MavrosRCController::MavrosRCController() {
// Wait for the mavros node to come up
if(!ros::service::waitForService(kModeService)) {
throw ros::Exception("Failed to wait for /mavros/set_mode to become available");
if (!ros::service::waitForService(kModeService)) {
throw ros::Exception(
"Failed to wait for /mavros/set_mode to become available");
}

if(!ros::service::waitForService(kArmingService)) {
throw ros::Exception("Failed to wait for /mavros/cmd/arming to become available");
if (!ros::service::waitForService(kArmingService)) {
throw ros::Exception(
"Failed to wait for /mavros/cmd/arming to become available");
}

rc_pub_ = nh_.advertise<OverrideRCIn>("/mavros/rc/override", 1);
Expand All @@ -41,7 +43,7 @@ MavrosRCController::MavrosRCController() {
mode_cmd.request.base_mode = 0;
mode_cmd.request.custom_mode = kModeDepthHold;

if(!mode_client_.call(mode_cmd)) {
if (!mode_client_.call(mode_cmd)) {
ROS_ERROR("Failed to set mavros mode");
}
}
Expand Down

0 comments on commit 4e58bf8

Please sign in to comment.