3 #include <std_msgs/Float64.h> 4 #include <std_msgs/Float32.h> 5 #include <std_srvs/Empty.h> 6 #include <std_msgs/Empty.h> 7 #include <std_msgs/Int32.h> 8 #include <std_msgs/MultiArrayLayout.h> 9 #include <std_msgs/MultiArrayDimension.h> 10 #include <std_msgs/Int32MultiArray.h> 11 #include <std_msgs/Float32MultiArray.h> 12 #include <std_msgs/Bool.h> 14 #include <nav_msgs/Odometry.h> 15 #include <sensor_msgs/Range.h> 33 #include <dynamic_reconfigure/server.h> 34 #include <mrp2_hardware/ParametersConfig.h> 100 robot_serial->update();
106 std::vector<int> imax ;
115 init_config.BUMPER_ESTOP = robot_serial->get_bumper_estop(
true);
125 robot_serial->reset_positions();
126 robot_serial->clear_diag(0);
142 std_msgs::Int32MultiArray array32;
152 long last_pos_l=0, now_pos_l=0;
153 long last_pos_r=0, now_pos_r=0;
169 double qpps_l, qpps_r;
174 double speed_l = (qpps_l/(21600.0))*2*M_PI;
175 double speed_r = (qpps_r/(21600.0))*2*M_PI;
188 array32.data.clear();
200 estop_release =
true;
209 b.data = estop_button;
237 std_msgs::Float32MultiArray spd_array;
238 spd_array.data.clear();
259 spd_array.data.push_back(0);
260 spd_array.data.push_back(0);
262 spd_array.data.push_back(
cmd_[0]*60*15/(2*M_PI));
263 spd_array.data.push_back(
cmd_[1]*60*15/(2*M_PI));
270 bool start_callback(std_srvs::Empty::Request& req, std_srvs::Empty::Response& res)
276 bool stop_callback(std_srvs::Empty::Request& req, std_srvs::Empty::Response& res)
294 void callback(mrp2_hardware::ParametersConfig &config, uint32_t level)
348 dynamic_reconfigure::Server<mrp2_hardware::ParametersConfig>
server;
349 dynamic_reconfigure::Server<mrp2_hardware::ParametersConfig>::CallbackType
f;
358 sprintf(cz_dummy,
"%9.5f",fValue);
359 double dValue = strtod(cz_dummy,NULL);
void registerInterface(T *iface)
hardware_interface::VelocityJointInterface jnt_vel_interface_
ros::Time getTime() const
void set_estop(bool value)
ros::Publisher sep_cmd_vel_pub
void positions_reset_callback(const std_msgs::Empty::ConstPtr &msg)
dynamic_reconfigure::Server< mrp2_hardware::ParametersConfig >::CallbackType f
Subscriber subscribe(const std::string &topic, uint32_t queue_size, void(T::*fp)(M), T *obj, const TransportHints &transport_hints=TransportHints())
ros::Publisher motor_stall_r_pub
std::vector< int > speeds
ros::Publisher controller_pub
std::vector< int > bumper_states
ServiceServer advertiseService(ros::NodeHandle n, std::string name, boost::function< bool(const typename ActionSpec::_action_goal_type::_goal_type &, typename ActionSpec::_action_result_type::_result_type &result)> service_cb)
bool stop_callback(std_srvs::Empty::Request &req, std_srvs::Empty::Response &res)
mrp2_hardware::ParametersConfig init_config
int get_speed_r(bool update=false)
ros::ServiceServer start_srv_
ros::Publisher bumpers_pub
ros::Publisher estop_btn_pub
bool get_estop(bool update=false)
ros::Publisher batt_low_pub
void publish(const boost::shared_ptr< M > &message) const
int get_speed_l(bool update=false)
hardware_interface::ImuSensorInterface imu_sens_interface_
void callback(mrp2_hardware::ParametersConfig &config, uint32_t level)
boost::mutex connect_mutex_
ros::Duration getPeriod() const
bool get_estop_button(bool update=false)
dynamic_reconfigure::Server< mrp2_hardware::ParametersConfig > server
hardware_interface::JointStateInterface jnt_state_interface_
Publisher advertise(const std::string &topic, uint32_t queue_size, bool latch=false)
bool start_callback(std_srvs::Empty::Request &req, std_srvs::Empty::Response &res)
ros::ServiceServer stop_srv_
void registerHandle(const JointStateHandle &handle)
void estop_clear_callback(const std_msgs::Empty::ConstPtr &msg)
void set_bumper_estop(bool value)
JointStateHandle getHandle(const std::string &name)
ros::Publisher aux_lights_pub
boost::recursive_mutex dynamic_reconfigure_mutex_
ros::Publisher motor_stall_l_pub
ros::Subscriber estop_clear_sub
std::vector< int > get_bumpers(bool update=false)
double _ftod(float fValue)
ros::Subscriber pos_reset_sub
ros::Publisher batt_high_pub
MRP2_Serial * robot_serial