navigation base controller output
Hi, I have wrote the following package totally the same as tutorials:robot_setup_tf,laser_scan_publisher,odometry_publisher. And I also wrote the following base controller package but when I run by roslaunch, it seems not call the callback. the base controller code:
#include <ros/ros.h>
#include <geometry_msgs/Twist.h>
#include <iostream>
using namespace std;
void cmdVelReceived(const geometry_msgs::Twist::ConstPtr& cmd_vel);
int main(int argc,char **argv)
{
cout << "123" << endl;
ros::init(argc, argv, "robot_setup_base");
ros::Subscriber cmd_vel_sub;
ros::NodeHandle node_;
cmd_vel_sub = node_.subscribe<geometry_msgs::Twist>("robot_0/cmd_vel", 1, boost::bind(cmdVelReceived,_1));
ros::spin();
return 0;
}
void cmdVelReceived(const geometry_msgs::Twist::ConstPtr& cmd_vel)
{
cout << "x=" << cmd_vel->linear.x << endl;
cout << "y=" << cmd_vel->linear.y << endl;
cout << "theta=" << cmd_vel->angular.z << endl;
}
And my launch file is
<launch>
<master auto="start"/>
<param name="/use_sim_time" value="true"/>
<node pkg="robot_setup_laser" type="laser" name="sensor_node_name" output="screen">
<param name="sensor_param" value="param_value" />
</node>
<node pkg="robot_setup_odometry" type="odometry" name="odom_node" output="screen">
<param name="odom_param" value="param_value" />
</node>
<node pkg="robot_setup_tf" type="tf_broadcaster" name="transform_configuration_name" output="screen">
<param name="transform_configuration_param" value="param_value" />
</node>
<node pkg="robot_setup_base" type="base" name="base" output="screen">
<param name="transform_configuration_param" value="param_value" />
</node>
<!--- Run AMCL -->
<include file="$(find amcl)/examples/amcl_diff.launch" />
<node pkg="map_server" type="map_server" name="map_server" args="$(find navigation_stage)/stage_config/maps/willow-full.pgm 0.1" respawn="false" >
<param name="frame_id" value="/map" />
</node>
<node pkg="stage" type="stageros" name="stageros" args="$(optenv ROS_STAGE_GRAPHICS -g) $(find navigation_stage)/stage_config/worlds/willow-pr2-multi.world" respawn="false">
<param name="base_watchdog_timeout" value="0.2"/>
</node>
<!-- Throttle the voxel grid that is being published for rviz -->
<node ns="move_base_node/local_costmap" name="voxel_grid_throttle" pkg="topic_tools" type="throttle" args="messages voxel_grid 3.0 voxel_grid_throttled" />
<group ns="robot_0">
<param name="tf_prefix" value="robot_0" />
<node pkg="move_base" type="move_base" respawn="false" name="move_base_node" output="screen">
<remap from="map" to="/map" />
<param name="controller_frequency" value="10.0" />
<rosparam file="$(find navigation_stage)/move_base_config/costmap_common_params.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find navigation_stage)/move_base_config/costmap_common_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find navigation_stage)/move_base_config/local_costmap_params.yaml" command="load" />
<rosparam file="$(find navigation_stage)/move_base_config/global_costmap_params.yaml" command="load" />
<rosparam file="$(find navigation_stage)/move_base_config/base_local_planner_params.yaml" command="load" />
</node>
<node pkg="fake_localization" type="fake_localization" name="fake_localization" respawn="false">
</node>
</group>
<node name="rviz" pkg="rviz" type="rviz" args="-d $(find navigation_stage)/multi_robot.vcg" />
</launch>
And the output:
sam@sam-M51Kr:~/code/ros/ira_navigation/nav_core/launch$ roslaunch robot_conf.launch
... logging to /home/sam/.ros/log/e84ff146-891a-11e0-93d5-0015afe5d6b9/roslaunch-sam-M51 Kr-4359.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
WARNING: ignoring defunct <master /> tag
started roslaunch server http://sam-M51Kr:41097/
SUMMARY
========
PARAMETERS
* /use_sim_time
* /amcl/gui_publish_rate
* /robot_0/move_base_node/TrajectoryPlannerROS/min_in_place_rotational_vel
* /base/transform_configuration_param
* /robot_0/move_base_node/TrajectoryPlannerROS/y_vels
* /robot_0/move_base_node/local_costmap/unknown_threshold
* /amcl/recovery_alpha_slow
* /amcl/laser_z_short
* /robot_0/move_base_node/local_costmap/origin_y
* /robot_0/move_base_node/TrajectoryPlannerROS/min_vel_x
* /robot_0/move_base_node/TrajectoryPlannerROS/sim_time
* /robot_0/move_base_node/TrajectoryPlannerROS/heading_lookahead
* /robot_0/move_base_node/global_costmap/base_scan/data_type
* /robot_0/move_base_node/global_costmap/static_map
* /amcl/laser_z_rand
* /robot_0/move_base_node/global_costmap/mark_threshold
* /robot_0/move_base_node/local_costmap/mark_threshold ...