ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
Thank you for your help! But I still try another way to test, just as follow:
message_filters::Subscriber<sensor_msgs::Imu> imu_sub(nh,"/starthit/imu/data", 1);
message_filters::Subscriber<sensor_msgs::JointState> joints_sub(nh,"/starthit/joint_states",1);
message_filters::Subscriber<gazebo_msgs::ContactsState> feet1_sub(nh,"/leg1_4_bumper",1);
message_filters::Subscriber<gazebo_msgs::ContactsState> feet2_sub(nh,"/leg2_4_bumper",1);
message_filters::Subscriber<gazebo_msgs::ContactsState> feet3_sub(nh,"/leg3_4_bumper",1);
message_filters::Subscriber<gazebo_msgs::ContactsState> feet4_sub(nh,"/leg4_4_bumper",1);
typedef message_filters::sync_policies::ApproximateTime<sensor_msgs::Imu,sensor_msgs::JointState,gazebo_msgs::ContactsState,gazebo_msgs::ContactsState,gazebo_msgs::ContactsState,gazebo_msgs::ContactsState> MySyncPolicy;
message_filters::Synchronizer<MySyncPolicy> sync(MySyncPolicy(10), imu_sub,joints_sub,feet1_sub,feet2_sub,feet3_sub,feet4_sub);
sync.registerCallback(boost::bind(&sensorcallback,_1,_2,_3,_4,_5,_6));
but IMU+joint_states+foot_sensors cann't inter callback, is there stlii have something wrong ?
2 | No.2 Revision |
Thank you for your help! But I still try another way to test, just as follow:
message_filters::Subscriber<sensor_msgs::Imu> imu_sub(nh,"/starthit/imu/data", imu_sub(nh,"/imu/data", 1);
message_filters::Subscriber<sensor_msgs::JointState> joints_sub(nh,"/starthit/joint_states",1);
joints_sub(nh,"/joint_states",1);
message_filters::Subscriber<gazebo_msgs::ContactsState> feet1_sub(nh,"/leg1_4_bumper",1);
message_filters::Subscriber<gazebo_msgs::ContactsState> feet2_sub(nh,"/leg2_4_bumper",1);
message_filters::Subscriber<gazebo_msgs::ContactsState> feet3_sub(nh,"/leg3_4_bumper",1);
message_filters::Subscriber<gazebo_msgs::ContactsState> feet4_sub(nh,"/leg4_4_bumper",1);
typedef message_filters::sync_policies::ApproximateTime<sensor_msgs::Imu,sensor_msgs::JointState,gazebo_msgs::ContactsState,gazebo_msgs::ContactsState,gazebo_msgs::ContactsState,gazebo_msgs::ContactsState> MySyncPolicy;
message_filters::Synchronizer<MySyncPolicy> sync(MySyncPolicy(10), imu_sub,joints_sub,feet1_sub,feet2_sub,feet3_sub,feet4_sub);
sync.registerCallback(boost::bind(&sensorcallback,_1,_2,_3,_4,_5,_6));
but IMU+joint_states+foot_sensors cann't inter callback, is there stlii have something wrong ?
3 | No.3 Revision |
Thank you for your help! But I still try another way to test, just as follow:
message_filters::Subscriber<sensor_msgs::Imu> imu_sub(nh,"/imu/data", 1);
message_filters::Subscriber<sensor_msgs::JointState> joints_sub(nh,"/joint_states",1);
message_filters::Subscriber<gazebo_msgs::ContactsState> feet1_sub(nh,"/leg1_4_bumper",1);
message_filters::Subscriber<gazebo_msgs::ContactsState> feet2_sub(nh,"/leg2_4_bumper",1);
message_filters::Subscriber<gazebo_msgs::ContactsState> feet3_sub(nh,"/leg3_4_bumper",1);
message_filters::Subscriber<gazebo_msgs::ContactsState> feet4_sub(nh,"/leg4_4_bumper",1);
typedef message_filters::sync_policies::ApproximateTime<sensor_msgs::Imu,sensor_msgs::JointState,gazebo_msgs::ContactsState,gazebo_msgs::ContactsState,gazebo_msgs::ContactsState,gazebo_msgs::ContactsState> MySyncPolicy;
message_filters::Synchronizer<MySyncPolicy> sync(MySyncPolicy(10), imu_sub,joints_sub,feet1_sub,feet2_sub,feet3_sub,feet4_sub);
sync.registerCallback(boost::bind(&sensorcallback,_1,_2,_3,_4,_5,_6));
but IMU+joint_states+foot_sensors cann't inter callback, is there stlii have something wrong ?
I forget to tell you, imu is 100hz, joints have 50hz, 4 foot_sensor have 50hz , when I use message fittler for imu + joints, the callback only have 40 hz , and for 4 foot_sensors, these only have 30hz, at now I don't know how to solve it, Thanks for your help!