NASA Astrobee Robot Software
0.19.1
Flight software for the Astrobee robots operating inside the International Space Station.
node_adder.h
Go to the documentation of this file.
1
/* Copyright (c) 2017, United States Government, as represented by the
2
* Administrator of the National Aeronautics and Space Administration.
3
*
4
* All rights reserved.
5
*
6
* The Astrobee platform is licensed under the Apache License, Version 2.0
7
* (the "License"); you may not use this file except in compliance with the
8
* License. You may obtain a copy of the License at
9
*
10
* http://www.apache.org/licenses/LICENSE-2.0
11
*
12
* Unless required by applicable law or agreed to in writing, software
13
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
14
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
15
* License for the specific language governing permissions and limitations
16
* under the License.
17
*/
18
19
#ifndef NODE_ADDERS_NODE_ADDER_H_
20
#define NODE_ADDERS_NODE_ADDER_H_
21
22
#include <
localization_common/time.h
>
23
24
#include <gtsam/nonlinear/Marginals.h>
25
26
namespace
node_adders
{
27
// Base class for adding nodes to a graph. A different node adder should be used
28
// for each node type added to the graph. Nodes can consist of multiple types that are added in unison,
29
// for example a pose and velocity. See the nodes package for more details.
30
// Assumes nodes require an initial values and prior factors.
31
class
NodeAdder
{
32
public
:
33
virtual
~NodeAdder
() {}
34
35
// Adds initial nodes and priors to constrain them during optimization.
36
virtual
void
AddInitialNodesAndPriors
(gtsam::NonlinearFactorGraph& graph) = 0;
37
38
// Adds a node using the provided timestamp if possible.
39
virtual
bool
AddNode
(
const
localization_common::Time
timestamp, gtsam::NonlinearFactorGraph& factors) = 0;
40
41
// Returns whether a node can be added at timestamp or not.
42
virtual
bool
CanAddNode
(
const
localization_common::Time
timestamp)
const
= 0;
43
44
// Returns keys for a node at the timestamp.
45
virtual
gtsam::KeyVector
Keys
(
const
localization_common::Time
timestamp)
const
= 0;
46
};
47
}
// namespace node_adders
48
49
#endif // NODE_ADDERS_NODE_ADDER_H_
node_adders::NodeAdder
Definition:
node_adder.h:31
node_adders
Definition:
between_factor_node_adder_model.h:35
node_adders::NodeAdder::~NodeAdder
virtual ~NodeAdder()
Definition:
node_adder.h:33
node_adders::NodeAdder::AddNode
virtual bool AddNode(const localization_common::Time timestamp, gtsam::NonlinearFactorGraph &factors)=0
node_adders::NodeAdder::Keys
virtual gtsam::KeyVector Keys(const localization_common::Time timestamp) const =0
node_adders::NodeAdder::AddInitialNodesAndPriors
virtual void AddInitialNodesAndPriors(gtsam::NonlinearFactorGraph &graph)=0
time.h
node_adders::NodeAdder::CanAddNode
virtual bool CanAddNode(const localization_common::Time timestamp) const =0
localization_common::Time
double Time
Definition:
time.h:23