tsd_value_converter.cc
Go to the documentation of this file.
00001 /*
00002  * Copyright 2018 The Cartographer Authors
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *      http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #include "cartographer/mapping/2d/tsd_value_converter.h"
00018 
00019 namespace cartographer {
00020 namespace mapping {
00021 
00022 TSDValueConverter::TSDValueConverter(float max_tsd, float max_weight,
00023                                      ValueConversionTables* conversion_tables)
00024     : max_tsd_(max_tsd),
00025       min_tsd_(-max_tsd),
00026       max_weight_(max_weight),
00027       tsd_resolution_(32766.f / (max_tsd_ - min_tsd_)),
00028       weight_resolution_(32766.f / (max_weight_ - min_weight_)),
00029       value_to_tsd_(
00030           conversion_tables->GetConversionTable(min_tsd_, min_tsd_, max_tsd_)),
00031       value_to_weight_(conversion_tables->GetConversionTable(
00032           min_weight_, min_weight_, max_weight)) {}
00033 
00034 }  // namespace mapping
00035 }  // namespace cartographer


cartographer
Author(s): The Cartographer Authors
autogenerated on Thu May 9 2019 02:27:36