moveit_robot.h
Go to the documentation of this file.
1 #ifndef MOVEIT_ROBOT_
2 #define MOVEIT_ROBOT_
3 
4 #include <ros/ros.h>
5 #include "impl/robot.h"
6 
7 #include <moveit/planning_pipeline/planning_pipeline.h>
8 #include <gb_grasp/MapGenerator.h>
9 
10 
11 
12 class Moveit_robot : public Robot{
13  protected:
14  std::shared_ptr<moveit::planning_interface::MoveGroupInterface> mgi_;
15  std::shared_ptr<moveit::planning_interface::MoveGroupInterface> mgi_hand_;
16 
17  std::map<std::string, std::string> map_;
18  std::shared_ptr<MapGenerator> grasp_map_generator_;
19 
20 
21 
22  public:
23  Moveit_robot(std::string& name, tf2::Transform tf, tf2::Vector3 size) : Robot(name, tf, size)
24  , mgi_(std::make_shared<moveit::planning_interface::MoveGroupInterface>(name)){
25 
26  std::stringstream hand_n, ik_frame_n, name_n, base_n;
27  hand_n << "hand_" << name.back();
28  ik_frame_n << "panda_" << name.back() << "_link8";
29  base_n << "base_" << name.back();
30  mgi_hand_ = std::make_shared<moveit::planning_interface::MoveGroupInterface>(hand_n.str());
31 
32 
33  map_.insert(std::make_pair<std::string, std::string>("right_finger", mgi_hand_->getLinkNames()[0].c_str()));
34  map_.insert(std::make_pair<std::string, std::string>("left_finger", mgi_hand_->getLinkNames()[1].c_str()));
35  map_.insert(std::make_pair<std::string, std::string>("hand_link", mgi_hand_->getLinkNames()[2].c_str()));
36  map_.insert(std::make_pair<std::string, std::string>("eef_name", hand_n.str()));
37  map_.insert(std::make_pair<std::string, std::string>("hand_frame", ik_frame_n.str()));
38  map_.insert(std::make_pair<std::string, std::string>("hand_group_name", hand_n.str()));
39  map_.insert(std::make_pair<std::string, std::string>("base", base_n.str()));
40 
41  }
42 
43  inline std::shared_ptr<moveit::planning_interface::MoveGroupInterface> mgi() {return mgi_;}
44  inline std::shared_ptr<moveit::planning_interface::MoveGroupInterface> mgi_hand() {return mgi_hand_;}
45  inline std::shared_ptr<MapGenerator> grasp_map_generator() {return grasp_map_generator_;}
46 
47 
48  inline std::map<std::string, std::string>& map(){return map_;}
49  inline void set_grasp_map_generator(std::shared_ptr<MapGenerator>const& d ){ grasp_map_generator_ = d;}
50 };
51 
52 #endif
robot.h
Moveit_robot::map
std::map< std::string, std::string > & map()
Definition: moveit_robot.h:48
Moveit_robot::mgi_hand
std::shared_ptr< moveit::planning_interface::MoveGroupInterface > mgi_hand()
Definition: moveit_robot.h:44
Moveit_robot::mgi_
std::shared_ptr< moveit::planning_interface::MoveGroupInterface > mgi_
Definition: moveit_robot.h:14
Moveit_robot::set_grasp_map_generator
void set_grasp_map_generator(std::shared_ptr< MapGenerator >const &d)
Definition: moveit_robot.h:49
Abstract_robot::name
std::string & name()
Definition: impl/abstract_robot.h:57
Abstract_robot::size
tf2::Vector3 & size()
Definition: impl/abstract_robot.h:59
Moveit_robot::mgi_hand_
std::shared_ptr< moveit::planning_interface::MoveGroupInterface > mgi_hand_
Definition: moveit_robot.h:15
Robot
Definition: robot.h:19
Abstract_robot::tf
tf2::Transform & tf()
Definition: impl/abstract_robot.h:58
Moveit_robot::grasp_map_generator_
std::shared_ptr< MapGenerator > grasp_map_generator_
Definition: moveit_robot.h:18
Moveit_robot
Definition: moveit_robot.h:12
Moveit_robot::map_
std::map< std::string, std::string > map_
Definition: moveit_robot.h:17
Moveit_robot::grasp_map_generator
std::shared_ptr< MapGenerator > grasp_map_generator()
Definition: moveit_robot.h:45
Moveit_robot::Moveit_robot
Moveit_robot(std::string &name, tf2::Transform tf, tf2::Vector3 size)
Definition: moveit_robot.h:23
Moveit_robot::mgi
std::shared_ptr< moveit::planning_interface::MoveGroupInterface > mgi()
Definition: moveit_robot.h:43


multi_cell_builder
Author(s): MA
autogenerated on Thu Jan 12 2023 23:45:43