Skip to content

Commit

Permalink
Changed pose to cmd_pose to show command intent
Browse files Browse the repository at this point in the history
  • Loading branch information
kleinma committed Sep 24, 2018
1 parent cfeb05c commit f5b16b3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/stageros.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
#define BASE_SCAN "base_scan"
#define BASE_POSE_GROUND_TRUTH "base_pose_ground_truth"
#define CMD_VEL "cmd_vel"
#define POSE "pose"
#define CMD_POSE "cmd_pose"

// Our node
class StageNode
Expand Down Expand Up @@ -98,7 +98,7 @@ class StageNode
std::vector<ros::Publisher> laser_pubs; //multiple lasers

ros::Subscriber cmdvel_sub; //one cmd_vel subscriber
ros::Subscriber pose_sub; //one pos subscriber
ros::Subscriber cmdpose_sub; //one pos subscriber
};

std::vector<StageRobot const *> robotmodels_;
Expand Down Expand Up @@ -165,7 +165,7 @@ class StageNode
void cmdvelReceived(int idx, const boost::shared_ptr<geometry_msgs::Twist const>& msg);

// Message callback for a Pose2D message, which sets pose.
void poseReceived(int idx, const boost::shared_ptr<geometry_msgs::Pose2D const>& msg);
void cmdposeReceived(int idx, const boost::shared_ptr<geometry_msgs::Pose2D const>& msg);

// Service callback for soft reset
bool cb_reset_srv(std_srvs::Empty::Request& request, std_srvs::Empty::Response& response);
Expand Down Expand Up @@ -273,7 +273,7 @@ StageNode::cmdvelReceived(int idx, const boost::shared_ptr<geometry_msgs::Twist
}

void
StageNode::poseReceived(int idx, const boost::shared_ptr<geometry_msgs::Pose2D const>& msg)
StageNode::cmdposeReceived(int idx, const boost::shared_ptr<geometry_msgs::Pose2D const>& msg)
{
boost::mutex::scoped_lock lock(msg_lock);
Stg::Pose pose;
Expand Down Expand Up @@ -372,7 +372,7 @@ StageNode::SubscribeModels()
new_robot->odom_pub = n_.advertise<nav_msgs::Odometry>(mapName(ODOM, r, static_cast<Stg::Model*>(new_robot->positionmodel)), 10);
new_robot->ground_truth_pub = n_.advertise<nav_msgs::Odometry>(mapName(BASE_POSE_GROUND_TRUTH, r, static_cast<Stg::Model*>(new_robot->positionmodel)), 10);
new_robot->cmdvel_sub = n_.subscribe<geometry_msgs::Twist>(mapName(CMD_VEL, r, static_cast<Stg::Model*>(new_robot->positionmodel)), 10, boost::bind(&StageNode::cmdvelReceived, this, r, _1));
new_robot->pose_sub = n_.subscribe<geometry_msgs::Pose2D>(mapName(POSE, r, static_cast<Stg::Model*>(new_robot->positionmodel)), 10, boost::bind(&StageNode::poseReceived, this, r, _1));
new_robot->cmdpose_sub = n_.subscribe<geometry_msgs::Pose2D>(mapName(CMD_POSE, r, static_cast<Stg::Model*>(new_robot->positionmodel)), 10, boost::bind(&StageNode::cmdposeReceived, this, r, _1));

for (size_t s = 0; s < new_robot->lasermodels.size(); ++s)
{
Expand Down

0 comments on commit f5b16b3

Please sign in to comment.