33 auto parent_link {link};
34 while ( (parent_link->parent_joint !=
nullptr) && (parent_link->parent_joint->type == urdf::Joint::FIXED) )
36 parent_link = parent_link->getParent();
38 return parent_link->parent_joint ==
nullptr;
45 int main(
int argc,
char** argv)
54 std::string reference_frame = model.getRoot()->name;
55 std::vector<urdf::LinkSharedPtr> links;
56 std::vector<std::string> frames_to_observe;
57 model.getLinks(links);
59 for (
const auto& link : links)
65 frames_to_observe.push_back(link->name);
68 std::vector<std::string> additional_frames;
71 for (
const auto& frame : additional_frames)
75 frames_to_observe.insert(frames_to_observe.end(), additional_frames.begin(), additional_frames.end());
83 catch(
const std::runtime_error& ex)
90 SpeedObserver observer(nh, reference_frame, frames_to_observe);
static const std::string ADDITIONAL_FRAMES_PARAM_NAME
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
ServiceServer advertiseService(const std::string &service, bool(T::*srv_func)(MReq &, MRes &), T *obj)
static const std::string OBSERVATION_FREQUENCY_PARAM_NAME
bool setSpeedLimitCb(SetSpeedLimit::Request &req, SetSpeedLimit::Response &res)
Callback for service to set the currently active speed limit.
URDF_EXPORT bool initParam(const std::string ¶m)
#define ROS_DEBUG_STREAM(args)
bool hasOnlyFixedParentJoints(const urdf::LinkSharedPtr &link)
#define ROS_ERROR_STREAM(args)
int main(int argc, char **argv)
Read requested parameters, start and initialize the prbt_hardware_support::SpeedObserver.
static const std::string SET_SPEED_LIMIT_SERVICE
void startObserving(const double frequency, const unsigned int allowed_missed_calculations=DEFAULT_ALLOWED_MISSED_CALCULATIONS)
Starts the observation cycle. The function blocks until ros shuts down.
static const std::string ROBOT_DESCRIPTION_PARAM_NAME