@@ -1145,6 +1145,9 @@ bool MoveItVisualTools::publishContactPoints(const collision_detection::Collisio
1145
1145
bool MoveItVisualTools::publishTrajectoryPoint (const trajectory_msgs::JointTrajectoryPoint& trajectory_pt,
1146
1146
const std::string& planning_group, double display_time)
1147
1147
{
1148
+ // Ensure robot_model_ is available
1149
+ loadSharedRobotState ();
1150
+
1148
1151
// Get joint state group
1149
1152
const moveit::core::JointModelGroup* jmg = robot_model_->getJointModelGroup (planning_group);
1150
1153
@@ -1171,6 +1174,9 @@ bool MoveItVisualTools::publishTrajectoryPoint(const trajectory_msgs::JointTraje
1171
1174
bool MoveItVisualTools::publishTrajectoryPath (const std::vector<moveit::core::RobotStatePtr>& trajectory,
1172
1175
const moveit::core::JointModelGroup* jmg, double speed, bool blocking)
1173
1176
{
1177
+ // Ensure robot_model_ is available
1178
+ loadSharedRobotState ();
1179
+
1174
1180
// Copy the vector of RobotStates to a RobotTrajectory
1175
1181
robot_trajectory::RobotTrajectoryPtr robot_trajectory (
1176
1182
new robot_trajectory::RobotTrajectory (robot_model_, jmg->getName ()));
@@ -1249,6 +1255,9 @@ bool MoveItVisualTools::publishTrajectoryPath(const moveit_msgs::RobotTrajectory
1249
1255
return false ;
1250
1256
}
1251
1257
1258
+ // Ensure that the robot name is available.
1259
+ loadSharedRobotState ();
1260
+
1252
1261
// Create the message
1253
1262
moveit_msgs::DisplayTrajectory display_trajectory_msg;
1254
1263
display_trajectory_msg.model_id = robot_model_->getName ();
@@ -1546,7 +1555,7 @@ bool MoveItVisualTools::hideRobot()
1546
1555
1547
1556
void MoveItVisualTools::showJointLimits (const moveit::core::RobotStatePtr& robot_state)
1548
1557
{
1549
- const std::vector<const moveit::core::JointModel*>& joints = robot_model_ ->getActiveJointModels ();
1558
+ const std::vector<const moveit::core::JointModel*>& joints = robot_state-> getRobotModel () ->getActiveJointModels ();
1550
1559
1551
1560
// Loop through joints
1552
1561
for (std::size_t i = 0 ; i < joints.size (); ++i)
0 commit comments