Go to the documentation of this file.
30 #ifndef EXOTICA_CORE_SCENE_H_
31 #define EXOTICA_CORE_SCENE_H_
40 #include <moveit_msgs/PlanningScene.h>
49 #include <exotica_core/scene_initializer.h>
62 #ifndef EXOTICA_CORE_DYNAMICS_SOLVER_H_
63 template <
typename T,
int NX,
int NU>
77 const std::string&
GetName()
const;
97 std::map<std::string, std::weak_ptr<KinematicElement>>
GetTreeMap();
99 void SetModelState(
const std::map<std::string, double>&
x,
double t = 0,
bool update_traj =
true);
102 void AddTrajectory(
const std::string& link,
const std::string& traj);
103 void AddTrajectory(
const std::string& link, std::shared_ptr<Trajectory> traj);
104 std::shared_ptr<Trajectory>
GetTrajectory(
const std::string& link);
122 void AttachObjectLocal(
const std::string&
name,
const std::string& parent,
const Eigen::VectorXd& pose);
130 void AddObject(
const std::string&
name,
const KDL::Frame&
transform = KDL::Frame(),
const std::string& parent =
"",
shapes::ShapeConstPtr shape =
shapes::ShapeConstPtr(
nullptr),
const KDL::RigidBodyInertia& inertia = KDL::RigidBodyInertia::Zero(),
const Eigen::Vector4d& color = Eigen::Vector4d(0.5, 0.5, 0.5, 1.0),
const bool update_collision_scene =
true);
132 void AddObject(
const std::string&
name,
const KDL::Frame&
transform = KDL::Frame(),
const std::string& parent =
"",
const std::string& shape_resource_path =
"",
const Eigen::Vector3d& scale = Eigen::Vector3d::Ones(),
const KDL::RigidBodyInertia& inertia = KDL::RigidBodyInertia::Zero(),
const Eigen::Vector4d& color = Eigen::Vector4d(0.5, 0.5, 0.5, 1.0),
const bool update_collision_scene =
true);
155 visualization_msgs::Marker
ProxyToMarker(
const std::vector<CollisionProxy>& proxies,
const std::string& frame);
156 void LoadScene(
const std::string& scene,
const Eigen::Isometry3d&
offset = Eigen::Isometry3d::Identity(),
bool update_collision_scene =
true);
157 void LoadScene(
const std::string& scene,
const KDL::Frame&
offset = KDL::Frame(),
bool update_collision_scene =
true);
158 void LoadSceneFile(
const std::string& file_name,
const Eigen::Isometry3d&
offset = Eigen::Isometry3d::Identity(),
bool update_collision_scene =
true);
159 void LoadSceneFile(
const std::string& file_name,
const KDL::Frame&
offset = KDL::Frame(),
bool update_collision_scene =
true);
201 std::shared_ptr<DynamicsSolver>
dynamics_solver_ = std::shared_ptr<DynamicsSolver>(
nullptr);
210 planning_scene::PlanningScenePtr
ps_;
249 #endif // EXOTICA_CORE_SCENE_H_
std::set< std::string > world_links_to_exclude_from_collision_scene_
List of world links to be excluded from the collision scene.
std::set< std::string > robot_links_to_exclude_from_collision_scene_
List of robot links to be excluded from the collision scene.
AttachedObject(std::string _parent, KDL::Frame _pose)
const std::string & GetName() const
std::string GetRootJointName()
void Update(Eigen::VectorXdRefConst x, double t=0)
void DetachObject(const std::string &name)
Detaches an object and leaves it a at its current world location. This effectively attaches the objec...
std::shared_ptr< DynamicsSolver > GetDynamicsSolver() const
Returns a pointer to the CollisionScene.
int get_num_positions() const
std::shared_ptr< Trajectory > GetTrajectory(const std::string &link)
Eigen::VectorXd GetModelState()
int get_num_state_derivative() const
ros::Publisher proxy_pub_
void AttachObject(const std::string &name, const std::string &parent)
Attaches existing object to a new parent. E.g. attaching a grasping target to the end-effector....
std::map< std::string, std::vector< std::string > > controlled_joint_to_collision_link_map_
Mapping between controlled joint name and collision links.
ros::Publisher ps_pub_
Visual debug.
moveit_msgs::PlanningScene GetPlanningSceneMsg()
Returns the current robot configuration and collision environment as a moveit_msgs::PlanningScene.
The class of EXOTica Scene.
void UpdatePlanningScene(const moveit_msgs::PlanningScene &scene)
Update the collision scene from a moveit_msgs::PlanningScene.
std::map< std::string, double > GetModelStateMap()
bool get_has_quaternion_floating_base() const
void AttachObjectLocal(const std::string &name, const std::string &parent, const KDL::Frame &pose)
Attaches existing object to a new parent specifying an offset in the new parent local frame.
std::map< std::string, std::weak_ptr< KinematicElement > > GetTreeMap()
void UpdateSceneFrames()
Updates exotica scene object frames from the MoveIt scene.
KinematicsRequest kinematic_request_
CollisionScenePtr collision_scene_
The collision scene.
std::vector< std::string > GetModelLinkNames()
std::map< std::string, std::pair< std::weak_ptr< KinematicElement >, std::shared_ptr< Trajectory > > > trajectory_generators_
std::vector< std::string > GetControlledLinkNames()
std::map< std::string, std::vector< std::string > > model_link_to_collision_link_map_
Mapping between model link names and collision links.
bool AlwaysUpdatesCollisionScene() const
Whether the collision scene transforms get updated on every scene update.
exotica::KinematicTree & GetKinematicTree()
template Halfspace< double > transform(const Halfspace< double > &a, const Transform3< double > &tf)
std::map< std::string, AttachedObject > attached_objects_
List of attached objects These objects will be reattached if the scene gets reloaded.
const CollisionScenePtr & GetCollisionScene() const
Returns a pointer to the CollisionScene.
bool request_needs_updating_
std::function< void(std::shared_ptr< KinematicResponse >)> kinematic_request_callback_
void UpdateInternalFrames(bool update_request=true)
Eigen::VectorXd GetControlledState()
int get_num_state() const
std::map< std::string, std::vector< std::shared_ptr< KinematicElement > > > model_link_to_collision_element_map_
bool HasAttachedObject(const std::string &name)
void RemoveTrajectory(const std::string &link)
void AddObjectToEnvironment(const std::string &name, const KDL::Frame &transform=KDL::Frame(), shapes::ShapeConstPtr shape=nullptr, const Eigen::Vector4d &color=Eigen::Vector4d(0.5, 0.5, 0.5, 1.0), const bool update_collision_scene=true)
void RequestKinematics(KinematicsRequest &request, std::function< void(std::shared_ptr< KinematicResponse >)> callback)
std::shared_ptr< Scene > ScenePtr
const typedef Eigen::Ref< const Eigen::VectorXd > & VectorXdRefConst
Convenience wrapper for storing references to sub-matrices/vectors.
bool has_quaternion_floating_base_
Whether the state includes a SE(3) floating base.
void UpdateTrajectoryGenerators(double t=0)
virtual void Instantiate(const SceneInitializer &init)
void AddTrajectory(const std::string &link, const std::string &traj)
void LoadSceneFromStringStream(std::istream &in, const Eigen::Isometry3d &offset, bool update_collision_scene)
void UpdateCollisionObjects()
planning_scene::PlanningScenePtr ps_
Internal MoveIt planning scene.
std::vector< std::string > GetControlledJointNames()
std::shared_ptr< CollisionScene > CollisionScenePtr
std::string GetRootFrameName()
int get_num_velocities() const
void SetModelState(Eigen::VectorXdRefConst x, double t=0, bool update_traj=true)
int get_num_controls() const
void LoadSceneFile(const std::string &file_name, const Eigen::Isometry3d &offset=Eigen::Isometry3d::Identity(), bool update_collision_scene=true)
std::vector< std::string > GetModelJointNames()
void UpdateMoveItPlanningScene()
Updates the internal state of the MoveIt PlanningScene from Kinematica.
void PublishProxies(const std::vector< CollisionProxy > &proxies)
void LoadScene(const std::string &scene, const Eigen::Isometry3d &offset=Eigen::Isometry3d::Identity(), bool update_collision_scene=true)
void AddTrajectoryFromFile(const std::string &link, const std::string &traj)
void AddObject(const std::string &name, const KDL::Frame &transform=KDL::Frame(), const std::string &parent="", shapes::ShapeConstPtr shape=shapes::ShapeConstPtr(nullptr), const KDL::RigidBodyInertia &inertia=KDL::RigidBodyInertia::Zero(), const Eigen::Vector4d &color=Eigen::Vector4d(0.5, 0.5, 0.5, 1.0), const bool update_collision_scene=true)
const std::set< std::string > & get_world_links_to_exclude_from_collision_scene() const
Returns world links that are to be excluded from collision checking.
void RemoveObject(const std::string &name)
const std::map< std::string, std::vector< std::string > > & GetControlledJointToCollisionLinkMap() const
Returns a map between controlled robot joint names and associated collision link names....
visualization_msgs::Marker ProxyToMarker(const std::vector< CollisionProxy > &proxies, const std::string &frame)
const std::map< std::string, std::vector< std::string > > & GetModelLinkToCollisionLinkMap() const
Returns a map between a model link name and the names of associated collision links.
void init(const M_string &remappings)
std::shared_ptr< const Shape > ShapeConstPtr
std::vector< std::shared_ptr< KinematicElement > > custom_links_
List of frames/links added on top of robot links and scene objects defined in the MoveIt scene.
int num_state_derivative_
"ndx"
const std::map< std::string, std::vector< std::shared_ptr< KinematicElement > > > & GetModelLinkToCollisionElementMap() const
Returns a map between a model link name and the KinematicElement of associated collision links.
void UpdatePlanningSceneWorld(const moveit_msgs::PlanningSceneWorldConstPtr &world)
Update the collision scene from a moveit_msgs::PlanningSceneWorld.
std::shared_ptr< KinematicResponse > kinematic_solution_
AbstractDynamicsSolver< double, Eigen::Dynamic, Eigen::Dynamic > DynamicsSolver
AttachedObject(std::string _parent)
exotica::KinematicTree kinematica_
The kinematica tree.
geometry_msgs::TransformStamped t
std::shared_ptr< DynamicsSolver > dynamics_solver_
The dynamics solver.
exotica_core
Author(s): Yiming Yang, Michael Camilleri
autogenerated on Fri Aug 2 2024 08:43:02