0
$\begingroup$

Rosanswers logo

Hey there

A few weeks ago i finally brought the navigation on my Kobuki with an IMU (Beaglebone Blue), RPLidar and UP Squared as processing Unit up running. The localization came from google Cartographer. The drive commands came from move_base. Back then the local costmap as well as the global costmap contained the obstacles. This week i tried to tune the local and global planner for a smoother driving experience. Since i wanted to test it before tuning the local costmap stays empty. The navigation still works, but due to the lack of the local costmap the robot drives just straight to its goal. I think the problem is, that the move_base node does not subscribe to the scan topic. But i do not figure out how to force him to do so. I also tried to launch some backups, but the behaviour is the same.

my TF_tree is:

  • map (map-odom = global SLAM)
  • odom (odom-base_footprint = local SLAM)
  • base_footprint (base_footprint - base_link = (0, 0, 0, 1) quaterninon with own tf broadcaster)
  • base_link (base_link - scan/imu_link = direction on robot with urdf)
  • scan / imu_link

The Cartographer is still working well and provides the Transformation as far as i can see. The topic /scan and /imu are both published and seem right. A picture from the Navigation with the empty costamp is added here: navigation with empty costmap .

Does anyone has some ideas, which might bring my robot to update the local_costmap? The important files are added below and the others are in: https://github.com/goeldisandro/autonomous_turtlebot_navigation.

thanks a lot for your help!

greetings from Switzerland

Edit:

  1. the first failure is:
[ WARN] [1562752396.232648210]: Control loop missed its desired rate

of 20.0000Hz... the loop actually took 0.1233 seconds

am i right, that this is just a performance issue?

  1. there is also an Error that i do not really know, what does it mean
[ERROR] [1562757979.010348657]: Kobuki : malformed sub-payload

detected. [28][170][1C AA 55 4D 01 0F A4 18 00 00 ]

the Error also showed up before, which makes me think it is not important. I also found no way to fix it (already tried updating Kobuki).

this is the Output when i launch

>  NODES   /
>     bumper2pointcloud (nodelet/nodelet)
>     cartographer_node (cartographer_ros/cartographer_node)
>     cartographer_occupancy_grid_node (cartographer_ros/cartographer_occupancy_grid_node)
>     cmd_vel_mux (nodelet/nodelet)
>     diagnostic_aggregator (diagnostic_aggregator/aggregator_node)
>     mobile_base (nodelet/nodelet)
>     mobile_base_nodelet_manager (nodelet/nodelet)
>     move_base (move_base/move_base)
>     robot_state_publisher (robot_state_publisher/robot_state_publisher)
>     rplidarNode (rplidar_ros/rplidarNode)
>     rviz (rviz/rviz)
>     tf_broadcaster_base (robot_setup_tf/tf_broadcaster_base)
> 
> ROS_MASTER_URI=http://localhost:11311
> 
> process[rplidarNode-1]: started with
> pid [18294] [ INFO]
> [1562752257.374873089]: RPLIDAR
> running on ROS package rplidar_ros.
> SDK Version:1.9.0 process[rviz-2]:
> started with pid [18317]
> process[tf_broadcaster_base-3]:
> started with pid [18318]
> process[robot_state_publisher-4]:
> started with pid [18319]
> process[diagnostic_aggregator-5]:
> started with pid [18328]
> process[mobile_base_nodelet_manager-6]:
> started with pid [18337]
> process[mobile_base-7]: started with
> pid [18349]
> process[bumper2pointcloud-8]: started
> with pid [18359]
> process[cmd_vel_mux-9]: started with
> pid [18371]
> process[cartographer_node-10]: started
> with pid [18380]
> process[cartographer_occupancy_grid_node-11]:
> started with pid [18392]
> process[move_base-12]: started with
> pid [18400] RPLIDAR S/N:
> 9A719DF1C3E39AC4C3E698F96AA6340D [
> INFO] [1562752257.881906950]: Firmware
> Ver: 1.22 [ INFO]
> [1562752257.881974240]: Hardware Rev:
> 4 [ INFO] [1562752257.883779796]:
> RPLidar health status : 0 [ INFO]
> [1562752257.985728070]: I0710
> 11:50:57.000000 18380
> configuration_file_resolver.cc:41]
> Found
> '/home/ba_slam/cartographer_ws/src/cartographer_ros/cartographer_ros/configuration_files/00_Kobuki_rp.lua'
> for '00_Kobuki_rp.lua'. [ INFO]
> [1562752257.987426247]: I0710
> 11:50:57.000000 18380
> configuration_file_resolver.cc:41]
> Found
> '/home/ba_slam/cartographer_ws/devel/share/cartographer/configuration_files/map_builder.lua'
> for 'map_builder.lua'. [ INFO]
> [1562752257.987598917]: I0710
> 11:50:57.000000 18380
> configuration_file_resolver.cc:41]
> Found
> '/home/ba_slam/cartographer_ws/devel/share/cartographer/configuration_files/map_builder.lua'
> for 'map_builder.lua'. [ INFO]
> [1562752257.987808587]: I0710
> 11:50:57.000000 18380
> configuration_file_resolver.cc:41]
> Found
> '/home/ba_slam/cartographer_ws/devel/share/cartographer/configuration_files/pose_graph.lua'
> for 'pose_graph.lua'. [ INFO]
> [1562752257.987901850]: I0710
> 11:50:57.000000 18380
> configuration_file_resolver.cc:41]
> Found
> '/home/ba_slam/cartographer_ws/devel/share/cartographer/configuration_files/pose_graph.lua'
> for 'pose_graph.lua'. [ INFO]
> [1562752257.988332994]: I0710
> 11:50:57.000000 18380
> configuration_file_resolver.cc:41]
> Found
> '/home/ba_slam/cartographer_ws/devel/share/cartographer/configuration_files/trajectory_builder.lua'
> for 'trajectory_builder.lua'. [ INFO]
> [1562752257.988450937]: I0710
> 11:50:57.000000 18380
> configuration_file_resolver.cc:41]
> Found
> '/home/ba_slam/cartographer_ws/devel/share/cartographer/configuration_files/trajectory_builder.lua'
> for 'trajectory_builder.lua'. [ INFO]
> [1562752257.988581582]: I0710
> 11:50:57.000000 18380
> configuration_file_resolver.cc:41]
> Found
> '/home/ba_slam/cartographer_ws/devel/share/cartographer/configuration_files/trajectory_builder_2d.lua'
> for 'trajectory_builder_2d.lua'. [
> INFO] [1562752257.988645624]: I0710
> 11:50:57.000000 18380
> configuration_file_resolver.cc:41]
> Found
> '/home/ba_slam/cartographer_ws/devel/share/cartographer/configuration_files/trajectory_builder_2d.lua'
> for 'trajectory_builder_2d.lua'. [
> INFO] [1562752257.988852747]: I0710
> 11:50:57.000000 18380
> configuration_file_resolver.cc:41]
> Found
> '/home/ba_slam/cartographer_ws/devel/share/cartographer/configuration_files/trajectory_builder_3d.lua'
> for 'trajectory_builder_3d.lua'. [
> INFO] [1562752257.988921703]: I0710
> 11:50:57.000000 18380
> configuration_file_resolver.cc:41]
> Found
> '/home/ba_slam/cartographer_ws/devel/share/cartographer/configuration_files/trajectory_builder_3d.lua'
> for 'trajectory_builder_3d.lua'. [
> INFO] [1562752258.114430775]: I0710
> 11:50:58.000000 18380
> submap_2d.cc:187] Added submap 1 [
> INFO] [1562752258.115023651]: I0710
> 11:50:58.000000 18380
> map_builder_bridge.cc:130] Added
> trajectory with ID '0'.
> *WARN* YOU ARE USING DEPRECATED API: checkExpressScanSupported(bool&,_u32),
> PLEASE MOVE TO
> getAllSupportedScanModes()
> *WARN* YOU ARE USING DEPRECATED API: getSampleDuration_uS, PLEASE MOVE TO
> RplidarScanMode::us_per_sample [ INFO]
> [1562752258.444524413]: current scan
> mode: Express, max_distance: 16.0 m,
> Point number: 4.0K , angle_compensate:
> 1 [ INFO] [1562752259.450757348]:
> I0710 11:50:59.000000 18380
> ordered_multi_queue.cc:172] All sensor
> data for trajectory 0 is available
> starting at '636983490592470290'. [
> INFO] [1562752259.459931002]: I0710
> 11:50:59.000000 18380
> local_trajectory_builder_2d.cc:295]
> Extrapolator not yet initialized. [
> INFO] [1562752259.460716740]: I0710
> 11:50:59.000000 18380
> local_trajectory_builder_2d.cc:138]
> Extrapolator is still initializing. [
> INFO] [1562752259.779842259]: Using
> plugin "inflation_layer" [ INFO]
> [1562752259.839573107]: Using plugin
> "obstacle_layer" [ INFO]
> [1562752259.850007963]:     Subscribed
> to Topics:  [ INFO]
> [1562752259.904408469]: Using plugin
> "static" [ INFO]
> [1562752259.923724893]: Requesting the
> map... [ INFO] [1562752260.534940461]:
> I0710 11:51:00.000000 18564
> constraint_builder_2d.cc:281] 0
> computations resulted in 0 additional
> constraints. [ INFO]
> [1562752260.535028402]: I0710
> 11:51:00.000000 18564
> constraint_builder_2d.cc:283] Score
> histogram: Count: 0 [ INFO]
> [1562752260.950443339]: Resizing
> costmap to 253 X 298 at 0.050000 m/pix
> [ INFO] [1562752261.049889954]:
> Received a 253 X 298 map at 0.050000
> m/pix [ INFO] [1562752261.275003153]:
> Using plugin "inflation_layer" [ INFO]
> [1562752261.327043181]: Using plugin
> "obstacle_layer" [ INFO]
> [1562752261.337899506]:     Subscribed
> to Topics:  [ INFO]
> [1562752261.576562595]: Created
> local_planner
> base_local_planner/TrajectoryPlannerROS
> [ INFO] [1562752261.637342018]: Sim
> period is set to 0.05 [ INFO]
> [1562752262.090252309]: I0710
> 11:51:02.000000 18565
> constraint_builder_2d.cc:281] 0
> computations resulted in 0 additional
> constraints. [ INFO]
> [1562752262.090433582]: I0710
> 11:51:02.000000 18565
> constraint_builder_2d.cc:283] Score
> histogram: Count: 0 [ INFO]
> [1562752263.603204008]: I0710
> 11:51:03.000000 18567
> constraint_builder_2d.cc:281] 0
> computations resulted in 0 additional
> constraints. [ INFO]
> [1562752263.603293735]: I0710
> 11:51:03.000000 18567
> constraint_builder_2d.cc:283] Score
> histogram: Count: 0 [ INFO]
> [1562752265.119344471]: I0710
> 11:51:05.000000 18566
> constraint_builder_2d.cc:281] 0
> computations resulted in 0 additional
> constraints. [ INFO]
> [1562752265.119722578]: I0710
> 11:51:05.000000 18566
> constraint_builder_2d.cc:283] Score
> histogram: Count: 0 [ INFO]
> [1562752266.547201919]: Recovery
> behavior will clear layer obstacles [
> INFO] [1562752266.572262375]: Recovery
> behavior will clear layer obstacles [
> INFO] [1562752266.594959262]: I0710
> 11:51:06.000000 18564
> constraint_builder_2d.cc:281] 0
> computations resulted in 0 additional
> constraints. [ INFO]
> [1562752266.595056956]: I0710
> 11:51:06.000000 18564
> constraint_builder_2d.cc:283] Score
> histogram: Count: 0 [ INFO]
> [1562752266.738288652]: odom received!
> [ INFO] [1562752266.738613186]:
> Resizing costmap to 258 X 300 at
> 0.050000 m/pix [ WARN] [1562752267.638960736]: Control loop
> missed its desired rate of
> 20.0000Hz... the loop actually took 0.1520 seconds [ WARN] [1562752267.823463989]: Control loop
> missed its desired rate of
> 20.0000Hz... the loop actually took 0.1845 seconds ... [ WARN] [1562752272.640044091]: Control loop
> missed its desired rate of
> 20.0000Hz... the loop actually took 0.1776 seconds [ WARN] [1562752272.715136084]: Control loop
> missed its desired rate of
> 20.0000Hz... the loop actually took 0.0751 seconds ^C[move_base-12] killing on exit
> [cartographer_occupancy_grid_node-11]
> killing on exit [cartographer_node-10]
> killing on exit [cmd_vel_mux-9]
> killing on exit [mobile_base-7]
> killing on exit [bumper2pointcloud-8]
> killing on exit
> [robot_state_publisher-4] killing on
> exit [diagnostic_aggregator-5] killing
> on exit [tf_broadcaster_base-3]
> killing on exit
> [mobile_base_nodelet_manager-6]
> killing on exit [rviz-2] killing on
> exit [rplidarNode-1] killing on exit
> Optimizing: Done.      Optimizing:
> Done.      shutting down processing
> monitor... ... shutting down
> processing monitor complete

the info from the scan topic is:

ba_slam@ba-slam-UP:~/cartographer_ws$ rostopic info scan
Type: sensor_msgs/LaserScan

Publishers: 
 * /rplidarNode (http://ba-slam-UP:45345/)

Subscribers: 
 * /cartographer_node (http://ba-slam-UP:43369/)
 * /rviz (http://ba-slam-UP:36927/)

and the info from the move_base node is:

ba_slam@ba-slam-UP:~/cartographer_ws$ rosnode info move_base
--------------------------------------------------------------------------------
Node [/move_base]
Publications: 
 * /cmd_vel_mux/input/teleop [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/parameter_descriptions [dynamic_reconfigure/ConfigDescription]
 * /move_base/global_costmap/static/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 [nav_msgs/Odometry]
 * /tf [tf2_msgs/TFMessage]
 * /tf_static [tf2_msgs/TFMessage]

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/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://ba-slam-UP:41509/ ...
Pid: 22239
Connections:
 * topic: /rosout
    * to: /rosout
    * direction: outbound
    * transport: TCPROS
 * topic: /cmd_vel_mux/input/teleop
    * to: /mobile_base_nodelet_manager
    * direction: outbound
    * transport: TCPROS
 * topic: /move_base/current_goal
    * to: /rviz
    * direction: outbound
    * transport: TCPROS
 * topic: /move_base/goal
    * to: /move_base
    * direction: outbound
    * transport: INTRAPROCESS
 * topic: /move_base/global_costmap/costmap
    * to: /rviz
    * direction: outbound
    * transport: TCPROS
 * topic: /move_base/global_costmap/costmap_updates
    * to: /rviz
    * direction: outbound
    * transport: TCPROS
 * topic: /move_base/global_costmap/costmap_updates
    * to: /rviz
    * direction: outbound
    * transport: TCPROS
 * topic: /move_base/local_costmap/footprint
    * to: /rviz
    * direction: outbound
    * transport: TCPROS
 * 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: /robot_state_publisher (http://ba-slam-UP:36387/)
    * direction: inbound
    * transport: TCPROS
 * topic: /tf
    * to: /tf_broadcaster_base (http://ba-slam-UP:33787/)
    * direction: inbound
    * transport: TCPROS
 * topic: /tf
    * to: /cartographer_node (http://ba-slam-UP:43369/)
    * direction: inbound
    * transport: TCPROS
 * topic: /tf
    * to: /mobile_base_nodelet_manager (http://ba-slam-UP:34767/)
    * direction: inbound
    * transport: TCPROS
 * topic: /tf_static
    * to: /robot_state_publisher (http://ba-slam-UP:36387/)
    * direction: inbound
    * transport: TCPROS
 * topic: /move_base_simple/goal
    * to: /rviz (http://ba-slam-UP:36927/)
    * direction: inbound
    * transport: TCPROS
 * topic: /map
    * to: /cartographer_occupancy_grid_node (http://ba-slam-UP:44597/)
    * direction: inbound
    * transport: TCPROS
 * topic: /odom
    * to: /mobile_base_nodelet_manager (http://ba-slam-UP:34767/)
    * direction: inbound
    * transport: TCPROS
 * topic: /move_base/goal
    * to: /move_base (http://ba-slam-UP:41509/)
    * direction: inbound
    * transport: INTRAPROCESS

my launch file is:

<launch>

<param name="/use_sim_time" value="false"/>


<!-- RPlidar starten #################################################################### -->

  <node name="rplidarNode"          pkg="rplidar_ros"  type="rplidarNode" output="screen">
  <param name="serial_port"         type="string" value="/dev/ttyUSB1"/>
  <param name="serial_baudrate"     type="int"    value="115200"/>
  <param name="frame_id"            type="string" value="laser"/>
  <param name="inverted"            type="bool"   value="false"/>
  <param name="angle_compensate"    type="bool"   value="true"/>
  </node> 



<!-- RVIZ starten #################################################################### -->
  <node name="rviz" pkg="rviz" type="rviz" args="-d $(find rplidar_ros)/rviz/rplidar.rviz" /> 




<!-- eigene tf_broadcaster/listener einbinden############################################## --> 
<node name="tf_broadcaster_base" pkg="robot_setup_tf" type="tf_broadcaster_base" /> 



<!-- Turtlebot  bringup ################################################################## -->
<include file =  "$(find turtlebot_bringup)/launch/minimal.launch"/>


<!---Cartographer ######################      -->

  <param name="robot_description"
    textfile="$(find cartographer_ros)/urdf/00_Kobuki_rp.urdf" />
  <node name="cartographer_node" pkg="cartographer_ros"
      type="cartographer_node" args="
          -configuration_directory $(find cartographer_ros)/configuration_files
          -configuration_basename 00_Kobuki_rp.lua"

      output="screen">
  </node>

  <node name="cartographer_occupancy_grid_node" pkg="cartographer_ros"
      type="cartographer_occupancy_grid_node" args="-resolution 0.05" /> 


<!-- move base node  ########################################################################## 
local_costmap params macht keine Probleme mehr -> Kommentare aus .yaml file geloescht-->
 <!---->  <param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS"/>
   <param name="base_global_planner" value="carrot_planner/CarrotPlanner"/>
  <param name="robot_description"
    textfile="$(find cartographer_ros)/urdf/00_Kobuki_rp.urdf" />

   <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">

   <rosparam file="$(find kobuki_nav)/global_costmap_params.yaml" command="load"  /> 
   <rosparam file = "$(find kobuki_nav)/local_costmap_params.yaml" command="load" />
   <rosparam file = "$(find kobuki_nav)/costmap_common_params.yaml" command="load" />

   <rosparam file="$(find kobuki_nav)/dwa_local_planner_params.yaml" command="load" />
   <rosparam file="$(find kobuki_nav)/base_local_planner_params.yaml" command="load" /> 
   </node>
  <!---->


  
</launch>

my URDF is:

<robot name="ba_roboter">
  <material name="orange">
    <color rgba="1.0 0.5 0.2 1" />
  </material>

  <link name="map">
    <visual>
      <origin xyz="0.0 0.0 0.0" />
      <geometry>
        <box size="0.5 0.5 0.5" />
      </geometry>
      <material name="blue" />
    </visual>
  </link>

  <link name="laser">
    <visual>
      <origin xyz="0.0 0.0 0.0" />
      <geometry>
        <box size="0.1 0.1 0.1" />
      </geometry>
      <material name="orange" />
    </visual>
  </link>


  <link name="imu_link">
    <visual>
      <origin xyz="0.0 0.0 0.0" />
      <geometry>
        <box size="0.1 0.1 0.1" />
      </geometry>
      <material name="orange" />
    </visual>
  </link>

  <link name="odom">
    <visual>
      <origin xyz="0.0 0.0 0.0" />
      <geometry>
        <box size="0.5 0.5 0.5" />
      </geometry>
      <material name="blue" />
    </visual>
  </link>

  <link name="base_link">
    <visual>
      <origin xyz="0.0 0.0 0.0" />
      <geometry>
        <box size="1 1 1" />
      </geometry>
      <material name="red" />
    </visual>
  </link>



  <joint name="odom_joint" type="floating">
    <parent link="map" />
    <child link="odom" />
    <origin xyz="0 0 0" />
  </joint>

  <joint name="base_joint" type="floating">
    <parent link="odom" />
    <child link="base_link" />
    <origin rpy="0 0 0"   xyz="0 0 0.1" />
  </joint>


  <joint name="rp_joint" type="fixed">
    <parent link="base_link" />
    <child link="laser" />
    <origin rpy="0 0 -0.872655" xyz="0 0 0.2" />
  </joint>

  <joint name="imu_joint" type="fixed">
    <parent link="base_link" />
    <child link="imu_link" />
    <origin rpy="0 0 -1.57" xyz="0 0 0" />
  </joint>



</robot>

my costmap_common_parameters\

  # aus früheren .yaml files
  obstacle_range: 10
  raytrace_range: 10
  map_type: costmap

  global_frame: map
  robot_base_frame: base_link
  footprint: [[0.36,0.0], [0.28, 0.24],[0, 0.36], [-0.47, 0.15], [-0.47,-0.15], [0.0,-0.36], [0.28,-0.24]]
  robot_radius: 0.25 #Radius des Roboters (Kobuki = 0.18 m)
  inflation_radius: 0.1  #Abstand den der Roboter zu Hindernisse einhalten soll



  meter_scoring: true

  static_layer:
    map_topic: /map
    subscribe_to_updates: true
    static_map: true


  obstacle_layer:
    enabled: true
    observation_sources: laser_scan_sensor
    laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: scan, marking: true, clearing: true, expected_update_rate: 0.5}
# obstacle_range: 6.0, raytrace_range: 8.5, max_obstacle_height: 5.0, min_obstacle_height: 0.0}

  inflater_layer:
    inflation_radius: 1.0
    cost_scaling_factor: 1.0

my local_costmap_parameters\

local_costmap:
  global_frame: /odom #/odom
  robot_base_frame: /base_link
  update_frequency: 0.2
  publish_frequency: 0.2
  static_map: false
  rolling_window: true
  width: 6.0
  height: 6.0
  resolution: 0.05

#padding is 0.1 by default, which makes it difficult to pass through narrow places
#footprint_padding: 0.0
#lethal_cost_treshold: 10
  
  plugins:
    - {name: inflation_layer,        type: "costmap_2d::InflationLayer"}
    - {name: obstacle_layer,         type: "costmap_2d::ObstacleLayer"}

  transform_tolerance: 1.0

my global_costmap_parameters\

global_costmap:
#https://answers.ros.org/question/12194/initializing-a-costmap_2d-with-a-static_map/
  #publish_voxel_map: true  #aus Vorlage kopiert
  global_frame: /map   #definiert wo global costmap laufen soll
  robot_base_frame: /base_link  #wohinn der costmap referenzieren soll
  update_frequency: 0.2
  publish_frequency: 0.2
  static_map: true   #ob sich der global costmap auf die vom map Server zur verfügung gestellte Map initailisieren soll
#  rolling_window: false #following robot while navigation
# width: 40.0
# height: 40.0
  resolution: 1.0
  always_send_full_costmap: true
  lethal_cost_treshold: 0
  obstacle_range: 5
  max_obstacle_height: 3.0 #leicht höher als Roboter
  raytracing_range: 3.0 #default
  cost_scaling_factor: 10.0 #default
  
  plugins:
    - {name: inflation_layer,        type: "costmap_2d::InflationLayer"}
    - {name: obstacle_layer,         type: "costmap_2d::ObstacleLayer"}
    - {name: static,                 type: "costmap_2d::StaticLayer"}  

  transform_tolerance: 1.0`enter code here`

Originally posted by goeldisandro on ROS Answers with karma: 21 on 2019-07-10

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Regarding the Control loop missed its desired rate warning check out this answer. You might need to reduce the controller_frequency parameter in move_base.launch. Also check if the scanner is actually publishing LaserScan messages on the /scan topic.
In addition, what do you think by local costmap stays empty"? No new obstacles can be seen in the local costmap but the ones from the map are seen on the static global costmap? In move_base case the global planner plans a path around the obstacles detected in global_costmap and and local planner tries to avoid obstacles on the path detected in local_costmap.

I checked you costmap_common_params.yaml file and I see that you have commented out some sensor parameters in the obstacle_layer. Try setting it like this and recheck if the frame/topics are correct:

  obstacle_layer:
    observation_sources: laser_scan_sensor
    laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: scan, marking: true, clearing: true, min_obstacle_height: 0.0, max_obstacle_height: 5.0, obstacle_range: 6.0, raytrace_range: 8.5}

Also no point in having the global_frame and robot_base_frame in costmap_common_params.yaml if you are reinitializing them in the local and global costmap params files. Plus be careful with any namespaces and "/" in the names.

I would put the plugins before the layer description in costmap_common_params.yaml:

  plugins:
    - {name: inflation_layer,        type: "costmap_2d::InflationLayer"}
    - {name: obstacle_layer,         type: "costmap_2d::ObstacleLayer"}

and move the static_layer into your global_costmap params file

  static_layer:
    map_topic: /map
    subscribe_to_updates: true
    static_map: true

For example you can always checkout the jackal_navgation package which gives a good example on the configuration files


Originally posted by pavel92 with karma: 1655 on 2019-07-11

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by goeldisandro on 2019-07-11:
I will try your suggestions on monday and tell you the results asap.

As far as i can see the /scan topic is published right. I can also visualize the scan in rviz and it seems right. The only point is that the points, that are to close to the sensor get an undefined value.

I think i understand the concept with local/global planer/costmap. In a previous version of mine the obstacles first were added to the local costmap and later to the global costmap. This enabled the local as well as the global planer to find a good way. With the empty local costmap the planer just drives straight to its goal, no matter if there are some scanned obstacles on the route.

Thanks a lot for your help.

$\endgroup$

Your Answer

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