trajectory_timing_constraint.h
Go to the documentation of this file.
00001 /*
00002  * Software License Agreement (Apache License)
00003  *
00004  * Copyright (c) 2014, Southwest Research Institute
00005  *
00006  * Licensed under the Apache License, Version 2.0 (the "License");
00007  * you may not use this file except in compliance with the License.
00008  * You may obtain a copy of the License at
00009  *
00010  * http://www.apache.org/licenses/LICENSE-2.0
00011  *
00012  * Unless required by applicable law or agreed to in writing, software
00013  * distributed under the License is distributed on an "AS IS" BASIS,
00014  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00015  * See the License for the specific language governing permissions and
00016  * limitations under the License.
00017  */
00018 /*
00019  * trajectory_pt_transition.h
00020  *
00021  *  Created on: March 7, 2015
00022  *      Author: Jonathan Meyer
00023  */
00024 
00025 #ifndef TRAJECTORY_TIMING_CONSTRAINT_H
00026 #define TRAJECTORY_TIMING_CONSTRAINT_H
00027 
00028 #include <ros/console.h>
00029 
00030 namespace descartes_core
00031 {
00042   struct TimingConstraint
00043   {
00047     TimingConstraint()
00048       : lower(0.0)
00049       , upper(0.0)
00050     {}
00051 
00056     explicit TimingConstraint(double nominal)
00057       : lower(nominal)
00058       , upper(nominal)
00059     {
00060       if (nominal < 0.0)
00061       {
00062         ROS_WARN_STREAM("Nominal time value must be greater than or equal to 0.0");
00063         lower = 0.0;
00064         upper = 0.0;
00065       }
00066     }
00067 
00073     TimingConstraint(double lower, double upper)
00074       : lower(lower)
00075       , upper(upper)
00076     {
00077       if (lower < 0.0)
00078       {
00079         ROS_WARN_STREAM("Lower time value must be greater than or equal to 0.0");
00080         lower = 0.0;
00081       }
00082 
00083       if (upper < 0.0)
00084       {
00085         ROS_WARN_STREAM("Upper time value must be greater than or equal to 0.0");
00086         upper = 0.0;
00087       }
00088     }
00089 
00094     bool isSpecified() const { return upper > 0.0; }
00095 
00096     double lower, upper;
00097   };
00098 
00099 } // end namespace descartes core
00100 
00101 #endif /* TRAJECTORY_TIMING_CONSTRAINT_H */


descartes_core
Author(s): Dan Solomon
autogenerated on Wed Aug 26 2015 11:21:21