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() : lower(0.0), upper(0.0)
00048   {
00049   }
00050 
00055   explicit TimingConstraint(double nominal) : lower(nominal), upper(nominal)
00056   {
00057     if (nominal < 0.0)
00058     {
00059       ROS_WARN_STREAM("Nominal time value must be greater than or equal to 0.0");
00060       lower = 0.0;
00061       upper = 0.0;
00062     }
00063   }
00064 
00070   TimingConstraint(double lower, double upper) : lower(lower), upper(upper)
00071   {
00072     if (lower < 0.0)
00073     {
00074       ROS_WARN_STREAM("Lower time value must be greater than or equal to 0.0");
00075       lower = 0.0;
00076     }
00077 
00078     if (upper < 0.0)
00079     {
00080       ROS_WARN_STREAM("Upper time value must be greater than or equal to 0.0");
00081       upper = 0.0;
00082     }
00083   }
00084 
00089   bool isSpecified() const
00090   {
00091     return upper > 0.0;
00092   }
00093 
00094   double lower, upper;
00095 };
00096 
00097 }  // end namespace descartes core
00098 
00099 #endif /* TRAJECTORY_TIMING_CONSTRAINT_H */


descartes_core
Author(s): Dan Solomon
autogenerated on Thu Jun 6 2019 21:35:59