Skip to content

Commit c605a00

Browse files
committed
Replace namespace robot_[model|state] with moveit::core
1 parent 6f72824 commit c605a00

File tree

12 files changed

+27
-27
lines changed

12 files changed

+27
-27
lines changed

capabilities/src/execute_task_solution_capability.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ void ExecuteTaskSolutionCapability::preemptCallback() {
130130

131131
bool ExecuteTaskSolutionCapability::constructMotionPlan(const moveit_task_constructor_msgs::Solution& solution,
132132
plan_execution::ExecutableMotionPlan& plan) {
133-
robot_model::RobotModelConstPtr model = context_->planning_scene_monitor_->getRobotModel();
133+
moveit::core::RobotModelConstPtr model = context_->planning_scene_monitor_->getRobotModel();
134134

135-
robot_state::RobotState state(model);
135+
moveit::core::RobotState state(model);
136136
{
137137
planning_scene_monitor::LockedPlanningSceneRO scene(context_->planning_scene_monitor_);
138138
state = scene->getCurrentState();

core/src/merge.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ moveit::core::JointModelGroup* merge(const std::vector<const moveit::core::Joint
105105

106106
robot_trajectory::RobotTrajectoryPtr
107107
merge(const std::vector<robot_trajectory::RobotTrajectoryConstPtr>& sub_trajectories,
108-
const robot_state::RobotState& base_state, moveit::core::JointModelGroup*& merged_group,
108+
const moveit::core::RobotState& base_state, moveit::core::JointModelGroup*& merged_group,
109109
const trajectory_processing::TimeParameterization& time_parameterization) {
110110
if (sub_trajectories.size() <= 1)
111111
throw std::runtime_error("Expected multiple sub solutions");
@@ -141,7 +141,7 @@ merge(const std::vector<robot_trajectory::RobotTrajectoryConstPtr>& sub_trajecto
141141
std::vector<double> values;
142142
values.reserve(max_num_vars);
143143

144-
auto merged_state = std::make_shared<robot_state::RobotState>(base_state);
144+
auto merged_state = std::make_shared<moveit::core::RobotState>(base_state);
145145
while (true) {
146146
bool finished = true;
147147
size_t index = merged_traj->getWayPointCount();
@@ -151,7 +151,7 @@ merge(const std::vector<robot_trajectory::RobotTrajectoryConstPtr>& sub_trajecto
151151
continue; // no more waypoints in this sub solution
152152

153153
finished = false; // there was a waypoint, continue while loop
154-
const robot_state::RobotState& sub_state = sub->getWayPoint(index);
154+
const moveit::core::RobotState& sub_state = sub->getWayPoint(index);
155155
sub_state.copyJointGroupPositions(sub->getGroup(), values);
156156
merged_state->setJointGroupPositions(sub->getGroup(), values);
157157
}
@@ -162,7 +162,7 @@ merge(const std::vector<robot_trajectory::RobotTrajectoryConstPtr>& sub_trajecto
162162
// add waypoint without timing
163163
merged_traj->addSuffixWayPoint(merged_state, 0.0);
164164
// create new RobotState for next waypoint
165-
merged_state = std::make_shared<robot_state::RobotState>(*merged_state);
165+
merged_state = std::make_shared<moveit::core::RobotState>(*merged_state);
166166
}
167167

168168
// add timing

core/src/solvers/cartesian_path.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ bool CartesianPath::plan(const planning_scene::PlanningSceneConstPtr& from, cons
8989
const double* joint_positions) {
9090
state->setJointGroupPositions(jmg, joint_positions);
9191
state->update();
92-
return !sandbox_scene->isStateColliding(const_cast<const robot_state::RobotState&>(*state), jmg->getName()) &&
92+
return !sandbox_scene->isStateColliding(const_cast<const moveit::core::RobotState&>(*state), jmg->getName()) &&
9393
kcs.decide(*state).satisfied;
9494
};
9595

core/src/solvers/pipeline_planner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,10 @@ struct PlannerCache
5252
{
5353
using PlannerID = std::tuple<std::string, std::string>;
5454
using PlannerMap = std::map<PlannerID, std::weak_ptr<planning_pipeline::PlanningPipeline> >;
55-
using ModelList = std::list<std::pair<std::weak_ptr<const robot_model::RobotModel>, PlannerMap> >;
55+
using ModelList = std::list<std::pair<std::weak_ptr<const moveit::core::RobotModel>, PlannerMap> >;
5656
ModelList cache_;
5757

58-
PlannerMap::mapped_type& retrieve(const robot_model::RobotModelConstPtr& model, const PlannerID& id) {
58+
PlannerMap::mapped_type& retrieve(const moveit::core::RobotModelConstPtr& model, const PlannerID& id) {
5959
// find model in cache_ and remove expired entries while doing so
6060
ModelList::iterator model_it = cache_.begin();
6161
while (model_it != cache_.end()) {

core/src/stages/compute_ik.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,11 @@ namespace {
9898
// ??? TODO: provide callback methods in PlanningScene class / probably not very useful here though...
9999
// TODO: move into MoveIt core, lift active_components_only_ from fcl to common interface
100100
bool isTargetPoseCollidingInEEF(const planning_scene::PlanningSceneConstPtr& scene,
101-
robot_state::RobotState& robot_state, Eigen::Isometry3d pose,
102-
const robot_model::LinkModel* link, const robot_model::JointModelGroup* jmg = nullptr,
101+
moveit::core::RobotState& robot_state, Eigen::Isometry3d pose,
102+
const moveit::core::LinkModel* link, const moveit::core::JointModelGroup* jmg = nullptr,
103103
collision_detection::CollisionResult* collision_result = nullptr) {
104104
// consider all rigidly connected parent links as well
105-
const robot_model::LinkModel* parent = robot_model::RobotModel::getRigidlyConnectedParentLinkModel(link);
105+
const moveit::core::LinkModel* parent = moveit::core::RobotModel::getRigidlyConnectedParentLinkModel(link);
106106
if (parent != link) // transform pose into pose suitable to place parent
107107
pose = pose * robot_state.getGlobalLinkTransform(link).inverse() * robot_state.getGlobalLinkTransform(parent);
108108

@@ -116,10 +116,10 @@ bool isTargetPoseCollidingInEEF(const planning_scene::PlanningSceneConstPtr& sce
116116
while (parent) {
117117
pending_links.push_back(&parent->getName());
118118
link = parent;
119-
const robot_model::JointModel* joint = link->getParentJointModel();
119+
const moveit::core::JointModel* joint = link->getParentJointModel();
120120
parent = joint->getParentLinkModel();
121121

122-
if (joint->getType() != robot_model::JointModel::FIXED) {
122+
if (joint->getType() != moveit::core::JointModel::FIXED) {
123123
for (const std::string* name : pending_links)
124124
acm.setDefaultEntry(*name, true);
125125
pending_links.clear();
@@ -280,7 +280,7 @@ void ComputeIK::compute() {
280280
}
281281

282282
// determine IK link from ik_frame
283-
const robot_model::LinkModel* link = nullptr;
283+
const moveit::core::LinkModel* link = nullptr;
284284
geometry_msgs::PoseStamped ik_pose_msg;
285285
const boost::any& value = props.get("ik_frame");
286286
if (value.empty()) { // property undefined
@@ -311,7 +311,7 @@ void ComputeIK::compute() {
311311

312312
// validate placed link for collisions
313313
collision_detection::CollisionResult collisions;
314-
robot_state::RobotState sandbox_state{ scene->getCurrentState() };
314+
moveit::core::RobotState sandbox_state{ scene->getCurrentState() };
315315
bool colliding =
316316
!ignore_collisions && isTargetPoseCollidingInEEF(scene, sandbox_state, target_pose, link, jmg, &collisions);
317317

@@ -349,7 +349,7 @@ void ComputeIK::compute() {
349349
std::vector<double> compare_pose;
350350
const std::string& compare_pose_name = props.get<std::string>("default_pose");
351351
if (!compare_pose_name.empty()) {
352-
robot_state::RobotState compare_state(robot_model);
352+
moveit::core::RobotState compare_state(robot_model);
353353
compare_state.setToDefaultValues(jmg, compare_pose_name);
354354
compare_state.copyJointGroupPositions(jmg, compare_pose);
355355
} else
@@ -359,7 +359,7 @@ void ComputeIK::compute() {
359359

360360
IKSolutions ik_solutions;
361361
auto is_valid = [scene, ignore_collisions, min_solution_distance,
362-
&ik_solutions](robot_state::RobotState* state, const robot_model::JointModelGroup* jmg,
362+
&ik_solutions](moveit::core::RobotState* state, const moveit::core::JointModelGroup* jmg,
363363
const double* joint_positions) {
364364
for (const auto& sol : ik_solutions) {
365365
if (jmg->distance(joint_positions, sol.joint_positions.data()) < min_solution_distance)
@@ -419,7 +419,7 @@ void ComputeIK::compute() {
419419
solution.markAsFailure(ss.str());
420420
}
421421
// set scene's robot state
422-
robot_state::RobotState& solution_state = solution_scene->getCurrentStateNonConst();
422+
moveit::core::RobotState& solution_state = solution_scene->getCurrentStateNonConst();
423423
solution_state.setJointGroupPositions(jmg, ik_solutions[i].joint_positions.data());
424424
solution_state.update();
425425

core/src/stages/connect.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ void Connect::compute(const InterfaceState& from, const InterfaceState& to) {
152152
planning_scene::PlanningScenePtr end = start->diff();
153153
const moveit::core::JointModelGroup* jmg = final_goal_state.getJointModelGroup(pair.first);
154154
final_goal_state.copyJointGroupPositions(jmg, positions);
155-
robot_state::RobotState& goal_state = end->getCurrentStateNonConst();
155+
moveit::core::RobotState& goal_state = end->getCurrentStateNonConst();
156156
goal_state.setJointGroupPositions(jmg, positions);
157157
goal_state.update();
158158
intermediate_scenes.push_back(end);

core/src/stages/generate_grasp_pose.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ void GenerateGraspPose::compute() {
150150
const std::string& eef = props.get<std::string>("eef");
151151
const moveit::core::JointModelGroup* jmg = scene->getRobotModel()->getEndEffector(eef);
152152

153-
robot_state::RobotState& robot_state = scene->getCurrentStateNonConst();
153+
moveit::core::RobotState& robot_state = scene->getCurrentStateNonConst();
154154
try {
155155
applyPreGrasp(robot_state, jmg, props.property("pregrasp"));
156156
} catch (const moveit::Exception& e) {

core/src/stages/move_relative.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ static void visualizePlan(std::deque<visualization_msgs::Marker>& markers, Inter
166166
bool MoveRelative::compute(const InterfaceState& state, planning_scene::PlanningScenePtr& scene,
167167
SubTrajectory& solution, Interface::Direction dir) {
168168
scene = state.scene()->diff();
169-
const robot_model::RobotModelConstPtr& robot_model = scene->getRobotModel();
169+
const moveit::core::RobotModelConstPtr& robot_model = scene->getRobotModel();
170170
assert(robot_model);
171171

172172
const auto& props = properties();
@@ -282,7 +282,7 @@ bool MoveRelative::compute(const InterfaceState& state, planning_scene::Planning
282282
planner_->plan(state.scene(), *link, offset, target_eigen, jmg, timeout, robot_trajectory, path_constraints);
283283

284284
if (robot_trajectory) { // the following requires a robot_trajectory returned from planning
285-
robot_state::RobotStatePtr& reached_state = robot_trajectory->getLastWayPointPtr();
285+
moveit::core::RobotStatePtr& reached_state = robot_trajectory->getLastWayPointPtr();
286286
reached_state->updateLinkTransforms();
287287
const Eigen::Isometry3d& reached_pose = reached_state->getGlobalLinkTransform(link) * offset;
288288

core/src/stages/move_to.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ bool MoveTo::getPointGoal(const boost::any& goal, const Eigen::Isometry3d& ik_po
177177
bool MoveTo::compute(const InterfaceState& state, planning_scene::PlanningScenePtr& scene, SubTrajectory& solution,
178178
Interface::Direction dir) {
179179
scene = state.scene()->diff();
180-
const robot_model::RobotModelConstPtr& robot_model = scene->getRobotModel();
180+
const moveit::core::RobotModelConstPtr& robot_model = scene->getRobotModel();
181181
assert(robot_model);
182182

183183
const auto& props = properties();

visualization/motion_planning_tasks/src/task_display.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ void TaskDisplay::loadRobotModel() {
120120

121121
const srdf::ModelSharedPtr& srdf =
122122
rdf_loader_->getSRDF() ? rdf_loader_->getSRDF() : srdf::ModelSharedPtr(new srdf::Model());
123-
robot_model_.reset(new robot_model::RobotModel(rdf_loader_->getURDF(), srdf));
123+
robot_model_.reset(new moveit::core::RobotModel(rdf_loader_->getURDF(), srdf));
124124

125125
// Send to child class
126126
trajectory_visual_->onRobotModelLoaded(robot_model_);

0 commit comments

Comments
 (0)