state_storage.h
Go to the documentation of this file.
1 /*********************************************************************
2  * Software License Agreement (BSD License)
3  *
4  * Copyright (c) 2012, Willow Garage, Inc.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  *
11  * * Redistributions of source code must retain the above copyright
12  * notice, this list of conditions and the following disclaimer.
13  * * Redistributions in binary form must reproduce the above
14  * copyright notice, this list of conditions and the following
15  * disclaimer in the documentation and/or other materials provided
16  * with the distribution.
17  * * Neither the name of Willow Garage nor the names of its
18  * contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
24  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
25  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
27  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
28  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
29  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32  * POSSIBILITY OF SUCH DAMAGE.
33  *********************************************************************/
34 
35 /* Author: Ioan Sucan */
36 
37 #pragma once
38 
41 #include <moveit_msgs/RobotState.h>
42 
43 namespace moveit_warehouse
44 {
47 
48 MOVEIT_CLASS_FORWARD(RobotStateStorage); // Defines RobotStateStoragePtr, ConstPtr, WeakPtr... etc
49 
50 class RobotStateStorage : public MoveItMessageStorage
51 {
52 public:
53  static const std::string DATABASE_NAME;
54 
55  static const std::string STATE_NAME;
56  static const std::string ROBOT_NAME;
57 
59 
60  void addRobotState(const moveit_msgs::RobotState& msg, const std::string& name, const std::string& robot = "");
61  bool hasRobotState(const std::string& name, const std::string& robot = "") const;
62  void getKnownRobotStates(std::vector<std::string>& names, const std::string& robot = "") const;
63  void getKnownRobotStates(const std::string& regex, std::vector<std::string>& names,
64  const std::string& robot = "") const;
65 
67  bool getRobotState(RobotStateWithMetadata& msg_m, const std::string& name, const std::string& robot = "") const;
68 
69  void renameRobotState(const std::string& old_name, const std::string& new_name, const std::string& robot = "");
70 
71  void removeRobotState(const std::string& name, const std::string& robot = "");
72 
73  void reset();
74 
75 private:
76  void createCollections();
77 
79 };
80 } // namespace moveit_warehouse
moveit_message_storage.h
moveit_warehouse::RobotStateStorage::state_collection_
RobotStateCollection state_collection_
Definition: state_storage.h:110
boost::shared_ptr
moveit_warehouse::RobotStateStorage::addRobotState
void addRobotState(const moveit_msgs::RobotState &msg, const std::string &name, const std::string &robot="")
Definition: state_storage.cpp:67
moveit_warehouse::RobotStateStorage::hasRobotState
bool hasRobotState(const std::string &name, const std::string &robot="") const
Definition: state_storage.cpp:83
moveit_warehouse::RobotStateStorage::ROBOT_NAME
static const std::string ROBOT_NAME
Definition: state_storage.h:88
moveit_warehouse
Definition: constraints_storage.h:43
moveit_warehouse::RobotStateStorage::renameRobotState
void renameRobotState(const std::string &old_name, const std::string &new_name, const std::string &robot="")
Definition: state_storage.cpp:130
moveit_warehouse::RobotStateStorage::DATABASE_NAME
static const std::string DATABASE_NAME
Definition: state_storage.h:85
moveit_warehouse::RobotStateStorage::getKnownRobotStates
void getKnownRobotStates(std::vector< std::string > &names, const std::string &robot="") const
Definition: state_storage.cpp:100
moveit_warehouse::MOVEIT_CLASS_FORWARD
MOVEIT_CLASS_FORWARD(ConstraintsStorage)
moveit_warehouse::RobotStateStorage::STATE_NAME
static const std::string STATE_NAME
Definition: state_storage.h:87
class_forward.h
moveit_warehouse::RobotStateStorage::removeRobotState
void removeRobotState(const std::string &name, const std::string &robot="")
Definition: state_storage.cpp:143
moveit_warehouse::RobotStateStorage::reset
void reset()
Definition: state_storage.cpp:60
moveit_warehouse::RobotStateStorage::getRobotState
bool getRobotState(RobotStateWithMetadata &msg_m, const std::string &name, const std::string &robot="") const
Get the constraints named name. Return false on failure.
Definition: state_storage.cpp:113
moveit_warehouse::RobotStateCollection
warehouse_ros::MessageCollection< moveit_msgs::RobotState >::Ptr RobotStateCollection
Definition: state_storage.h:78
moveit_warehouse::RobotStateStorage::RobotStateStorage
RobotStateStorage(warehouse_ros::DatabaseConnection::Ptr conn)
Definition: state_storage.cpp:49
moveit_warehouse::RobotStateStorage::createCollections
void createCollections()
Definition: state_storage.cpp:55
moveit_warehouse::RobotStateWithMetadata
warehouse_ros::MessageWithMetadata< moveit_msgs::RobotState >::ConstPtr RobotStateWithMetadata
Definition: state_storage.h:77


warehouse
Author(s): Ioan Sucan
autogenerated on Thu Apr 18 2024 02:25:06