0
$\begingroup$

Rosanswers logo

hi,

I am trying to run a navigation-stack on my robot.I am currently using a hokuyo laser scanner to generate a map. i have ROS running on a laptop on the robot mainly for data acquisition, i also have a desktop pc with ROS for running most of the nodes.

At the moment i am able to make a map of the environment.I also can send my robot nav-goals. The only problem i am facing right now is that when the robot is moving toward its goal, it ignores all objects that are not on the static map. I think something is wrong with my costmap parameters. because if i set static_map to true the costmap_2d node dies with:

terminate called after throwing an instance of 'std::bad_alloc' what():  std::bad_alloc

nodes that are running:

costmap_node (costmap_2d/costmap_2d_node)
map_server (map_server/map_server)
amcl (amcl/amcl)
move_base (move_base/move_base)
move_platform (rosbee_control/move_platform)
tfbroadcaster (rosbee_tf/tfBroadcaster)
hokuyo_node (hokuyo_node/hokuyo_node)
openni_node1 (openni_camera/openni_node)
kinect_base_link (tf/static_transform_publisher)
kinect_base_link1 (tf/static_transform_publisher)
kinect_base_link2 (tf/static_transform_publisher)
kinect_base_link3 (tf/static_transform_publisher)
openni_manager (nodelet/nodelet)
pointcloud_throttle (nodelet/nodelet)
kinect_laser (nodelet/nodelet)

parameters (yaml files):

global_frame: /map
robot_base_frame: base_link
update_frequency: 5.0
publish_frequency: 2.0

#set to true if you want to initialize the costmap from a static map
static_map: true

transform_tolerance: 0.3
obstacle_range: 2.5
max_obstacle_height: 2.0
raytrace_range: 3.0
robot_radius: 0.31
footprint_padding: 0.01
inflation_radius: 0.75
cost_scaling_factor: 10.0
lethal_cost_threshold: 100
observation_sources: scan 

scan: {data_type: LaserScan, expected_update_rate: 0.4,
  observation_persistence: 0.0, marking: true, clearing: true, max_obstacle_height: 0.4, min_obstacle_height: 0.08}
map_type: "costmap"

 TrajectoryPlannerROS:
  max_vel_x: 2.0
  min_vel_x: 2.0
  max_rotational_vel: 2.0
  min_in_place_rotational_vel: 2.0
  xy_goal_tolerance: 0.3
  yaw_goal_tolerance: 0.2
  acc_lim_th: 1.0
  acc_lim_x: 1.0
  acc_lim_y: 1.0
  controller_frequency: 5.0
  holonomic_robot: false
  escape_vel: -1.0
  path_distance_bias: 1.0

launch files i am using:

Desktop PC:

<launch>
<!-- set a default value for the map -->
<arg name="map" default="/home/mechatronica/rosbee/bagfiles/Fontyslaser.yaml" />

<!-- load the parameters for the navigation stack/costmap -->
<node name="costmap_node" pkg="costmap_2d" type="costmap_2d_node" >
    <rosparam file="$(find rosbee_param)/config/costmap.yaml" command="load" ns="costmap" />
    <param name="/use_sim_time" value="false"/>
  </node>

<!-- start the map_server with the map parameter -->
<node name="map_server" pkg="map_server" type="map_server" args="$(arg map)" />

<!-- launch amcl for differential drive robots -->
<include file="$(find amcl)/examples/amcl_diff.launch" />

<node name="move_base" pkg="move_base" type="move_base" >
  <rosparam file="$(find rosbee_param)/config/base_local_planner_params.yaml" command="load"  />
</node>

<!-- start rviz -->
<node name="rviz" pkg="rviz" type="rviz" args="-d /home/mechatronica/rosbee/bagfiles/rosbee_config.vcg" />

</launch>

Robot:

 <launch>
    <!-- start the platform and tfbroadcaster -->
    <node name="move_platform" pkg="rosbee_control" type="move_platform" respawn="true" />
    <node name="tfbroadcaster" pkg="rosbee_tf" type="tfBroadcaster"/>

    <!-- start the laser -->    
    <node name="hokuyo_node" pkg="hokuyo_node" type="hokuyo_node" />

    <!-- start the kinect -->
    <include file="$(find pointcloud_to_laserscan)/launch/kinext_laser_2.launch" />
</launch>

Originally posted by svenr on ROS Answers with karma: 1 on 2011-08-29

Post score: 0


Original comments

Comment by Yannis on 2012-06-07:
If you solved your problem, do you know how I can on purpose have the robot ignore the obstacles with the navigation stack ? I'm using a turtlebot and I've built an obstacle avoidance algorithm, so I would like the robot to use my strategy, not the default one.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

I believe that your problem is that you're not specifying the correct namespaces for your parameters. TrajectoryPlannerROS will be in the correct namespace, but your costmaps have no idea where to look for their parameters.

The local planner is typically sourced with the rolling_window parameter set to true, and the global planner's is static. Additionally, it might be wise to specify the sensor frame of your laser scanner so that the robot can do the necessary transforms for the incoming data.

I would suggest looking at an example such as the erratic robot to get an idea of how to set it up more clearly. That way, you can be sure all of the parameters are specified and in the correct namespaces.


Originally posted by DimitriProsser with karma: 11163 on 2011-09-02

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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