本文整理汇总了C++中PowerCubeCtrl::statusMoving方法的典型用法代码示例。如果您正苦于以下问题:C++ PowerCubeCtrl::statusMoving方法的具体用法?C++ PowerCubeCtrl::statusMoving怎么用?C++ PowerCubeCtrl::statusMoving使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PowerCubeCtrl
的用法示例。
在下文中一共展示了PowerCubeCtrl::statusMoving方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updatePCubeCommands
/*!
* \brief Routine for updating command to the powercubes.
*
* Depending on the operation mode (position/velocity) either position or velocity goals are sent to the hardware.
*/
void updatePCubeCommands()
{
if (isInitialized_ == true)
{
std::string operationMode;
n_.getParam("OperationMode", operationMode);
if (operationMode == "position")
{
ROS_DEBUG("moving powercubes in position mode");
if (PCube_->statusMoving() == false)
{
//feedback_.isMoving = false;
ROS_DEBUG("next point is %d from %d",traj_point_nr_,traj_.points.size());
if (traj_point_nr_ < traj_.points.size())
{
// if powercubes are not moving and not reached last point of trajectory, then send new target point
ROS_DEBUG("...moving to trajectory point[%d]",traj_point_nr_);
traj_point_ = traj_.points[traj_point_nr_];
PCube_->MoveJointSpaceSync(traj_point_.positions);
traj_point_nr_++;
//feedback_.isMoving = true;
//feedback_.pointNr = traj_point_nr;
//as_.publishFeedback(feedback_);
}
else
{
ROS_DEBUG("...reached end of trajectory");
finished_ = true;
}
}
else
{
ROS_DEBUG("...powercubes still moving to point[%d]",traj_point_nr_);
}
}
else if (operationMode == "velocity")
{
ROS_DEBUG("moving powercubes in velocity mode");
if(newvel_)
{
ROS_INFO("MoveVel Call");
PCube_->MoveVel(cmd_vel_);
newvel_ = false;
}
}
else
{
ROS_ERROR("powercubes neither in position nor in velocity mode. OperationMode = [%s]", operationMode.c_str());
}
}
else
{
ROS_DEBUG("powercubes not initialized");
}
}