0
$\begingroup$

Rosanswers logo

Hi, I'm using a rosbot and I made a map with gmapping, now I want to run amcl and move_base for autonomus movement. My problem is that local costmap is empty because move_base doesn't subscribe to laser scan topic and it doesn't mark the obstacles.

launch:

<launch>
    
    
    <node pkg="controller" type="ros-core2-client" name="serial_node" output="screen">
      <param  name="baud" value="57600"/>
      <param  name="port" value="/dev/ttyS1"/>
    </node> 

    <arg name="map_file" default="$(find slam_setup)/maps/mapaIngIndustrial.yaml"/>

    <node pkg="slam_setup" type="slam_setup_node" name="tf_odom_baselink"/> 

    <node pkg="tf" type="static_transform_publisher" name="laser_broadcaster" 
        args="0 0 0 3.14 0 0 base_link laser_frame 100" />

    <node pkg="rplidar_ros" type="rplidarNode" name="rplidar"/>    

    <node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />

 
    <node pkg="amcl" type="amcl" name="amcl" output="screen">

          <param name="odom_frame_id" value="odom"/>

          <param name="odom_model_type" value="diff-corrected"/>

          <param name="base_frame_id" value="base_link"/>

          <param name="update_min_d" value="0.1"/>

          <param name="update_min_a" value="0.1"/>

          <param name="min_particles" value="250"/>

          <param name="max_particles" value="600"/>

          <param name="recovery_alpha_fast" value="0.1"/>

          <param name="odom_alpha1" value="0.2"/>

          <param name="odom_alpha2" value="0.2"/>

          <param name="odom_alpha3" value="0.2"/>

          <param name="odom_alpha4" value="0.2"/>

          <param name="use_map_topic" value="true"/>

      <param name="save_pose_rate" value="10"/>

          <param name="initial_pos_x" value="10.0"/>

          <param name="initial_pos_y" value="10.0"/>

          <param name="initial_cov_yy" value="100.0"/>

          <param name="initial_cov_xx" value="100.0"/>

          <param name="transform_tolerance" value="0.3"/>

    </node>

    <node pkg="move_base" type="move_base" name="move_base" output="screen">
    <param name="controller_frequency" value="10.0"/>
    
        <rosparam file="$(find rosbot_nav)/parametros/costmap_common_params.yaml" command="load" ns="global_costmap"/>
    <rosparam file="$(find rosbot_nav)/parametros/costmap_common_params.yaml" command="load" ns="local_costmap"/>
    <rosparam file="$(find rosbot_nav)/parametros/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find rosbot_nav)/parametros/global_costmap_params.yaml" command="load"/>
    <rosparam file="$(find rosbot_nav)/parametros/trajectory_planner.yaml" command="load"/>
    </node>

</launch>

costmap params:

common params:

obstacle_range: 2.5
raytrace_range: 3.0
footprint: [[0.15,0.15],[0.15,-0.15],[-0.15,-0.15],[-0.15,0.15]]
inflation_radius: 0.4
map_topic: map
resolution: 0.15
subscribe_to_updates: true
transform_tolerance: 0.2

obsevation_sources: laser_scan_sensor

laser_scan_sensor: {sensor_frame: laser_frame, data_type: LaserScan, topic: scan, clearing: true, marking: true}

local_costmap:

   update_frecuency: 5.0
   publish_frecuency: 1.0
   static_map: false
   rolling_window: true
   width: 3.0
   heigth: 3.0
   global_frame: odom
   robot_base_frame: base_link

global_costmap:

  update_frequency: 2.5
  static_map: true
  rolling_window: false
  global_frame: map
  robot_base_frame: base_link

TrajectoryPlannerROS:

  max_vel_theta: 0.5

  acc_lim_theta: 0.25
  holonomic_robot: false
  meter_scoring: true
  xy_goal_tolerance: 0.30
  yaw_goal_tolerance: 0.25
  controller_frequency: 10.0
  global_frame_id: map
  sim_time: 2.0
  sim_granularity: 0.05
  occdist_scale: 0.04
  pdist_scale: 0.3
  publish_cost_grid_pc: true
  dwa: true

I'm using ubuntu 16 and Ros Kinetic.

Now I include range sensor and move_base subscribe them with /tf, but doesn't subscribe to the laser. The local costmap is empty because It doesn't detect the obstacles. The laser and range sensor are working properly, I can see them in rviz.

rosnode info /move_base

Node [/move_base]
Publications: 
 * /cmd_vel [geometry_msgs/Twist]
 * /move_base/NavfnROS/plan [nav_msgs/Path]
 * /move_base/TrajectoryPlannerROS/cost_cloud [sensor_msgs/PointCloud2]
 * /move_base/TrajectoryPlannerROS/global_plan [nav_msgs/Path]
 * /move_base/TrajectoryPlannerROS/local_plan [nav_msgs/Path]
 * /move_base/TrajectoryPlannerROS/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /move_base/TrajectoryPlannerROS/parameter_updates [dynamic_reconfigure/Config]
 * /move_base/current_goal [geometry_msgs/PoseStamped]
 * /move_base/feedback [move_base_msgs/MoveBaseActionFeedback]
 * /move_base/global_costmap/costmap [nav_msgs/OccupancyGrid]
 * /move_base/global_costmap/costmap_updates [map_msgs/OccupancyGridUpdate]
 * /move_base/global_costmap/footprint [geometry_msgs/PolygonStamped]
 * /move_base/global_costmap/inflation_layer/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /move_base/global_costmap/inflation_layer/parameter_updates [dynamic_reconfigure/Config]
 * /move_base/global_costmap/obstacle_layer/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /move_base/global_costmap/obstacle_layer/parameter_updates [dynamic_reconfigure/Config]
 * /move_base/global_costmap/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /move_base/global_costmap/parameter_updates [dynamic_reconfigure/Config]
 * /move_base/global_costmap/static_layer/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /move_base/global_costmap/static_layer/parameter_updates [dynamic_reconfigure/Config]
 * /move_base/goal [move_base_msgs/MoveBaseActionGoal]
 * /move_base/local_costmap/costmap [nav_msgs/OccupancyGrid]
 * /move_base/local_costmap/costmap_updates [map_msgs/OccupancyGridUpdate]
 * /move_base/local_costmap/footprint [geometry_msgs/PolygonStamped]
 * /move_base/local_costmap/inflation_layer/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /move_base/local_costmap/inflation_layer/parameter_updates [dynamic_reconfigure/Config]
 * /move_base/local_costmap/obstacle_layer/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /move_base/local_costmap/obstacle_layer/parameter_updates [dynamic_reconfigure/Config]
 * /move_base/local_costmap/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /move_base/local_costmap/parameter_updates [dynamic_reconfigure/Config]
 * /move_base/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /move_base/parameter_updates [dynamic_reconfigure/Config]
 * /move_base/result [move_base_msgs/MoveBaseActionResult]
 * /move_base/status [actionlib_msgs/GoalStatusArray]
 * /rosout [rosgraph_msgs/Log]

Subscriptions: 
 * /map [nav_msgs/OccupancyGrid]
 * /move_base/cancel [unknown type]
 * /move_base/global_costmap/footprint [geometry_msgs/PolygonStamped]
 * /move_base/goal [move_base_msgs/MoveBaseActionGoal]
 * /move_base/local_costmap/footprint [geometry_msgs/PolygonStamped]
 * /move_base_simple/goal [geometry_msgs/PoseStamped]
 * /odom [unknown type]
 * /tf [tf2_msgs/TFMessage]
 * /tf_static [unknown type]

Services: 
 * /move_base/NavfnROS/make_plan
 * /move_base/TrajectoryPlannerROS/set_parameters
 * /move_base/clear_costmaps
 * /move_base/get_loggers
 * /move_base/global_costmap/inflation_layer/set_parameters
 * /move_base/global_costmap/obstacle_layer/set_parameters
 * /move_base/global_costmap/set_parameters
 * /move_base/global_costmap/static_layer/set_parameters
 * /move_base/local_costmap/inflation_layer/set_parameters
 * /move_base/local_costmap/obstacle_layer/set_parameters
 * /move_base/local_costmap/set_parameters
 * /move_base/make_plan
 * /move_base/set_logger_level
 * /move_base/set_parameters


contacting node http://rosbot-2249:41012/ ...
Pid: 1585
Connections:
 * topic: /rosout
    * to: /rosout
    * direction: outbound
    * transport: TCPROS
 * topic: /cmd_vel
    * to: /serial_node
    * direction: outbound
    * transport: TCPROS
 * topic: /move_base/goal
    * to: /move_base
    * direction: outbound
    * transport: INTRAPROCESS
 * topic: /move_base/local_costmap/costmap
    * to: /rviz
    * direction: outbound
    * transport: TCPROS
 * topic: /move_base/local_costmap/costmap_updates
    * to: /rviz
    * direction: outbound
    * transport: TCPROS
 * topic: /move_base/TrajectoryPlannerROS/global_plan
    * to: /rviz
    * direction: outbound
    * transport: TCPROS
 * topic: /move_base/TrajectoryPlannerROS/local_plan
    * to: /rviz
    * direction: outbound
    * transport: TCPROS
 * topic: /tf
    * to: /laser_broadcaster (http://rosbot-2249:44713/)
    * direction: inbound
    * transport: TCPROS
 * topic: /tf
    * to: /IFRR_Sensor (http://rosbot-2249:41702/)
    * direction: inbound
    * transport: TCPROS
 * topic: /tf
    * to: /IFFL_Sensor (http://rosbot-2249:38605/)
    * direction: inbound
    * transport: TCPROS
 * topic: /tf
    * to: /IFFR_Sensor (http://rosbot-2249:39743/)
    * direction: inbound
    * transport: TCPROS
 * topic: /tf
    * to: /IFRL_Sensor (http://rosbot-2249:32818/)
    * direction: inbound
    * transport: TCPROS
 * topic: /tf
    * to: /amcl (http://rosbot-2249:34436/)
    * direction: inbound
    * transport: TCPROS
 * topic: /tf
    * to: /tf_odom_baselink (http://rosbot-2249:45737/)
    * direction: inbound
    * transport: TCPROS
 * topic: /move_base_simple/goal
    * to: /rviz (http://diego-HP-Pavilion-Power-Laptop-15-cb0xx:42429/)
    * direction: inbound
    * transport: TCPROS
 * topic: /map
    * to: /map_server (http://rosbot-2249:39849/)
    * direction: inbound
    * transport: TCPROS
 * topic: /move_base/goal
    * to: /move_base (http://rosbot-2249:41012/)
    * direction: inbound
    * transport: INTRAPROCESS

My rqt_graph:

[IMG]http://i68.tinypic.com/k9z6sj.png[/IMG]


Originally posted by Diego_Perez on ROS Answers with karma: 28 on 2018-08-01

Post score: 0


Original comments

Comment by David Lu on 2018-08-01:
Can you please post the output of rosnode info /move_base

Comment by Diego_Perez on 2018-08-02:
I edit my question with the outpout, thanks.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Hi, I found the problem, I have a parameter with wrong name, observation_sources. Sorry for waste your time.


Originally posted by Diego_Perez with karma: 28 on 2018-08-02

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by pk99 on 2021-04-23:
what was the exact problem? was the topic /scan in observation_sources or something different?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.