36 #include <boost/chrono.hpp> 45 time_source::time_point &last_time)
49 time_source::time_point this_time = time_source::now();
50 boost::chrono::duration<double> elapsed_duration = this_time - last_time;
52 last_time = this_time;
69 int main(
int argc,
char *argv[])
74 double control_frequency, diagnostic_frequency;
75 private_nh.
param<
double>(
"control_frequency", control_frequency, 10.0);
76 private_nh.
param<
double>(
"diagnostic_frequency", diagnostic_frequency, 1.0);
89 time_source::time_point last_time = time_source::now();
92 boost::bind(
controlLoop, boost::ref(husky), boost::ref(cm), boost::ref(last_time)),
102 husky_spinner.
start();
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void reportLoopDuration(const ros::Duration &duration)
ROSCPP_DECL void spin(Spinner &spinner)
int main(int argc, char *argv[])
bool param(const std::string ¶m_name, T ¶m_val, const T &default_val) const
void diagnosticLoop(husky_base::HuskyHardware &husky)
Timer createTimer(Rate r, Handler h, Obj o, bool oneshot=false, bool autostart=true) const
boost::chrono::steady_clock time_source
void updateJointsFromHardware()
void update(const ros::Time &time, const ros::Duration &period, bool reset_controllers=false)
void controlLoop(husky_base::HuskyHardware &husky, controller_manager::ControllerManager &cm, time_source::time_point &last_time)
void writeCommandsToHardware()