ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Yuxi's profile - activity

2019-12-23 15:34:12 -0500 received badge  Famous Question (source)
2018-06-15 08:46:13 -0500 received badge  Notable Question (source)
2018-06-15 08:46:13 -0500 received badge  Popular Question (source)
2017-09-19 00:29:44 -0500 asked a question How to output ROS_ERROR info to log file in Indigo version

How to output ROS_ERROR info to log file in Indigo version Hi,I'm going to output the ROS_INFO,ROS_WARN,ROS_ERROR,ROS_FA

2017-09-19 00:28:16 -0500 asked a question How to output ROS_ERROR to log file in ros Indigo version

How to output ROS_ERROR to log file in ros Indigo version Hi,I'm going to output the ROS_INFO,ROS_WARN,ROS_ERROR,ROS_FAT

2017-07-31 14:50:21 -0500 received badge  Famous Question (source)
2017-05-04 08:49:32 -0500 received badge  Notable Question (source)
2017-05-04 08:49:32 -0500 received badge  Popular Question (source)
2017-04-09 11:40:26 -0500 answered a question map saved in orbslam2

This link may be helped youhttps://github.com/raulmur/ORB_SLAM2/issues/19,I used the http://recherche.enac.fr/~drouin/slam/orbslam2/poine_orbslam2_04_07_16.tgz which is wrote by @Michael and I can save the map and load the map successfully.(Note:when you use this package you should add the camera.with and camera.height in your yaml file). Good luck!

2017-03-08 20:49:52 -0500 received badge  Enthusiast
2017-03-04 22:35:10 -0500 asked a question The publish frequency of /amcl_pose in navigation amcl package is too low

Hi,I'm just starting to use amcl package, but I found that the publish frequency of /amcl_pose is too low ,the frequency of /scan is about 25HZ, but when I run "rostopic hz /amcl_pose" in terminal to check its frequency,I found that it is only about 1 hz or 2hz, is it a bug of amcl or there's something wrong with my parameters? This is my launch file:

<?xml version="1.0"?>
<launch>
<param name="use_sim_time" value="true"/>
<node pkg="amcl" type="amcl" name="amcl" output="screen"/>
<node pkg="tf" type="static_transform_publisher" name="map_nav_broadcaster" args="0 0 0 0 0 0 /base_link /laser 100"> 
<!-- Publish scans from best pose at a max of 10 Hz -->
<param name="use_map_topic" value="true"/>
<param name="odom_model_type" value="diff"/>
<param name="odom_alpha5" value="0.1"/>
<param name="transform_tolerance" value="0.2" />
<param name="gui_publish_rate" value="10.0"/>
<param name="laser_max_beams" value="30"/>
<param name="min_particles" value="500"/>
<param name="max_particles" value="5000"/>
<param name="kld_err" value="0.05"/>
<param name="kld_z" value="0.99"/>
<param name="odom_alpha1" value="0.2"/>
<param name="odom_alpha2" value="0.2"/>
<!-- translation std dev, m -->
<param name="odom_alpha3" value="0.8"/>
<param name="odom_alpha4" value="0.2"/>
<param name="laser_z_hit" value="0.5"/>
<param name="laser_z_short" value="0.05"/>
<param name="laser_z_max" value="0.05"/>
<param name="laser_z_rand" value="0.5"/>
<param name="laser_sigma_hit" value="0.2"/>
<param name="laser_lambda_short" value="0.1"/>
<param name="laser_lambda_short" value="0.1"/>
<param name="laser_model_type" value="likelihood_field"/>
<!-- <param name="laser_model_type" value="beam"/> -->
<param name="laser_likelihood_max_dist" value="2.0"/>
<param name="update_min_d" value="0.2"/>
<param name="update_min_a" value="0.5"/>
<param name="odom_frame_id" value="odom"/>
<param name="resample_interval" value="1"/>
<param name="transform_tolerance" value="0.1"/>
<param name="recovery_alpha_slow" value="0.0"/>
<param name="recovery_alpha_fast" value="0.0"/>
</node>

If anyone knows about this, please to tell me how to fix it, thx a lot. </launch>

2017-02-24 02:43:11 -0500 received badge  Famous Question (source)
2016-09-06 13:50:03 -0500 received badge  Notable Question (source)
2016-08-26 02:49:23 -0500 received badge  Popular Question (source)
2016-08-25 13:13:04 -0500 commented answer While using message_filters to do the time synchronization,but it cannot enter into the callback function

Thank you very much.!You are right. And I wrote the codes in main function and it works.

2016-08-25 13:06:36 -0500 received badge  Scholar (source)
2016-08-25 13:05:18 -0500 commented answer Ros indigo Re-installation problem

Thanks a lot !!

2016-08-25 13:04:33 -0500 received badge  Supporter (source)
2016-08-18 22:20:59 -0500 asked a question While using message_filters to do the time synchronization,but it cannot enter into the callback function

I am using sync_policies::ApproximateTime in message_filter to do the PointCloud2 and LaserScan time synchronization, but the problem is it cannot enter into the callback function ofsync.registerCallback(boost::bind(&Message_Filter::callback, this, _1, _2));. At first, I think that it is because the publishing frequency of the two topics are different which make the code cannot enter into the callback function, but when I write another publish node which publishes two topic almost at the same time, it still not work, so I really don't know where the problem is. Does anyone knows about this? Thanks a lot.

Here is my codes:

#include "message_filter_node.h"
Message_Filter::Message_Filter()
{
message_filters::Subscriber<sensor_msgs::PointCloud2> Velodyne_sub(nh, "/velodyne_points", 1);
message_filters::Subscriber<sensor_msgs::LaserScan> Hokuyo_sub(nh,"/scan" , 1);

typedef sync_policies::ApproximateTime<PointCloud2, LaserScan> MySyncPolicy;
// ApproximateTime takes a queue size as its constructor argument, hence MySyncPolicy(10)
Synchronizer<MySyncPolicy> sync(MySyncPolicy(100), Velodyne_sub, Hokuyo_sub);
sync.registerCallback(boost::bind(&Message_Filter::callback, this, _1, _2));

Velodyne_pub=nh.advertise<PointCloud2>("message_filter/velodyne_points",1);
Hokuyo_pub=nh.advertise<LaserScan>("message_filter/scan",1);
}
void Message_Filter::callback(const PointCloud2::ConstPtr& point_cloud2, const LaserScan::ConstPtr& laser_scan)
{
ROS_ERROR("Enter Publish");
Velodyne_pub.publish(point_cloud2);
Hokuyo_pub.publish(laser_scan);
}

Here is my header file:

#ifndef MESSAGE_FILTER_NODE_H
#define MESSAGE_FILTER_NODE_H
#include <message_filters/subscriber.h>
#include <message_filters/synchronizer.h>
#include <message_filters/sync_policies/approximate_time.h>
#include <sensor_msgs/Image.h>
#include <sensor_msgs/PointCloud2.h>
#include <sensor_msgs/LaserScan.h>
#include "image_transport/image_transport.h"
using namespace sensor_msgs;
using namespace message_filters;

class Message_Filter
{
public:
    Message_Filter();
    void callback(const PointCloud2::ConstPtr& point_cloud2, const LaserScan::ConstPtr& laser_scan);
public:
    ros::Publisher Velodyne_pub;
    ros::Publisher Hokuyo_pub;
    ros::NodeHandle nh;
};

#endif // MESSAGE_FILTER_NODE_H

Thanks Dimitri Schachmann , the problem was solved. And my codes are:

#include <message_filters/subscriber.h>
#include <message_filters/synchronizer.h>
#include <message_filters/sync_policies/approximate_time.h>
#include <sensor_msgs/Image.h>
#include <sensor_msgs/PointCloud2.h>
#include <sensor_msgs/LaserScan.h>
#include "image_transport/image_transport.h"
#include "ros/ros.h"
//ros::Publisher Velodyne_pub;
void callback(const sensor_msgs:: PointCloud2::ConstPtr& point_cloud2, const 
sensor_msgs::LaserScan::ConstPtr& laser_scan)
{
    ROS_ERROR("Enter Publish");
   // Velodyne_pub.publish(point_cloud2);
  //  Hokuyo_pub.publish(laser_scan);
}
int main(int argc, char** argv)
{
  ros::init(argc, argv, "message_filter_node");
  ros::Time::init();
  ros::NodeHandle nh;
  ROS_INFO("start message filter");
  message_filters::Subscriber<sensor_msgs::PointCloud2> Velodyne_sub(nh, "/velodyne_points", 1);
  message_filters::Subscriber<sensor_msgs::LaserScan> Hokuyo_sub(nh,"/scan" , 1);
  typedef message_filters::sync_policies::ApproximateTime<sensor_msgs::PointCloud2,  
  sensor_msgs::LaserScan> MySyncPolicy;
  // ApproximateTime takes a queue size as its constructor argument, hence MySyncPolicy(10)
  message_filters::Synchronizer<MySyncPolicy> sync(MySyncPolicy(10), Velodyne_sub, Hokuyo_sub);
  sync.registerCallback(boost::bind(&callback, _1, _2));

  ros::spin();
  return 0;
}