Hi
I am doing an experiment in different map size: 8X8, 16X16, 32X32 and 64X64, 128X128, and 256X256. The maps are simply white(free) squares and black (obstacle) squares which are randomly generated. Also, start and goal are randomly chosen. The maps are generated, then used in ROS.
That’s why I am not using other maps. I need simple map(grids) of black and white squares for experimental purposes in order to compare different planners. Moreover, these kind of maps are useful for beginners in robotics and ROS.
I have chosen simulated robot Rosbot2.0 to do this experiment. I wrote the launch file for the navigation stack with all required yaml files. However, the robot does not move.
This is how the map looks like in Rviz. The resolution is 1. The blue circle is the goal pose.
Here is my launch file: rosbot_navigation_move_rosbot.launch
<launch>
<arg name="use_rosbot" default="false"/>
<arg name="use_gazebo" default="true"/>
<param if="$(arg use_gazebo)" name="use_sim_time" value="true"/>
<!-- Bring the ROSbot model and show it in Gazebo and in Rviz -->
<include file="$(find rosbot_description)/launch/rosbot_rviz.launch"/>
<!-- NOTE: rosbot_rviz.launch includes: "$(find rosbot_description)/launch/rosbot.launch" which lanuches Gazebo -->
<!-- Map server -->
<arg name="map_file" default="$(find rosbot_navigation)/maps/gridMap8by8.yaml"/>
<node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" />
<!--- tf -->
<node if="$(arg use_rosbot)" pkg="tf" type="static_transform_publisher" name="base_link_to_laser" args="0 0 0 3.14 0 0 base_link laser 100" />
<node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" args="-param robot_description -urdf -x 1.5 -y 3.5 -z 0.0 -model rosbot" />
<node pkg="joint_state_publisher" type="joint_state_publisher" name="joint_state_publisher">
<param name="publish_frequency" type="double" value="30.0" />
</node>
<!--- Localization: Run AMCL -->
<node pkg="amcl" type="amcl" name="amcl" output="screen">
<remap from="scan" to="/scan"/>
<param name="odom_frame_id" value="odom"/>
<!-- <param name="odom_model_type" value="diff-corrected"/> -->
<param name="odom_model_type" value="diff"/>
<param name="base_frame_id" value="base_link"/>
<param name="update_min_d" value="0.05"/>
<param name="update_min_a" value="0.1"/>
<param name="min_particles" value="500"/>
<param name="max_particles" value="10000"/>
<param name="initial_pose_x" value="1.5"/>
<param name="initial_pose_y" value="3.5"/>
</node>
<!-- Move base -->
<node pkg="move_base" type="move_base" name="move_base" output="screen">
<param name="controller_frequency" value="0.5"/>
<rosparam file="$(find rosbot_navigation)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find rosbot_navigation)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find rosbot_navigation)/config/local_costmap_params.yaml" command="load" />
<rosparam file="$(find rosbot_navigation)/config/global_costmap_params.yaml" command="load" />
<rosparam file="$(find rosbot_navigation)/config/trajectory_planner.yaml" command="load" />
</node>
</launch>
These are the yaml files:
costmap_common_params.yaml
obstacle_range: 6.0
raytrace_range: 8.5
footprint: [[0.12, 0.14], [0.12, -0.14], [-0.12, -0.14], [-0.12, 0.14]]
map_topic: /map
subscribe_to_updates: true
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: scan, marking: true, clearing: true}
global_frame: map
robot_base_frame: base_link
always_send_full_costmap: true
global_costmap_params.yaml
global_costmap:
global_frame: map
update_frequency: 0.5
publish_frequency: 1.5
transform_tolerance: 1.0
width: 8
height: 8
origin_x: 0
origin_y: 0
static_map: true
rolling_window: false
inflation_radius: 0.0
cost_scaling_factor: 10.0
resolution: 1
local_costmap_params.yaml
local_costmap:
global_frame: map
update_frequency: 2.5
publish_frequency: 2.5
transform_tolerance: 1.0
static_map: false
rolling_window: true
width: 3
height: 3
origin_x: 0
origin_y: 0
resolution: 1
inflation_radius: 0.0
cost_scaling_factor: 10.0
trajectory_planner.yaml
TrajectoryPlannerROS:
max_vel_x: 0.1
min_vel_x: 0.05
max_vel_theta: 2.5
min_vel_theta: -2.5
min_in_place_vel_theta: 0.5
acc_lim_theta: 1.0
acc_lim_x: 1.5
acc_lim_Y: 1.5
holonomic_robot: false
xy_goal_tolerance: 3.0
yaw_goal_tolerance: 8.0
vx_samples: 6
vtheta_samples: 20
controller_frequency: 0.5
meter_scoring: true
occdist_scale: 0.01
pdist_scale: 0.4
gdist_scale: 0.2
path_distance_bias: 0.4
goal_distance_bias: 0.2
# dwa: true
The map pgm and yaml files:
.pgm files are not allowed for upload, so here it is: https://www.mediafire.com/file/iqyjr9go2amkkbv/gridMap8by8.pgm/file
gridMap8by8.yaml
image: gridMap8by8.pgm
resolution: 1
origin: [0,0,0]
occupied_thresh: 0.65
free_thresh: 0.196
negate: 0
width: 8
height: 8
In the terminal I run:
rosbot_navigation_move_rosbot.launch
I got:
[ INFO] [1608712815.531061064, 8.520000000]: odom received!
Then in another terminal, I send the goal:
rostopic pub /move_base_simple/goal geometry_msgs/PoseStamped ‘{header: {stamp: now, frame_id: “map”}, pose: {position: {x: 6.5, y: 3.5, z: 0.0}, orientation: {w: 1.0}}}’
I got:
publishing and latching message. Press ctrl-C to terminate
Then, I run:
rostopic list
/cmd_vel is listed
rostopic echo /cmd_vel
I got:
WARNING: no messages received and simulated time is active.
Is /clock being published?
In Rviz:
The robot does not move, and a blue line appears( inside the red ellipse).
I have chosen a goal that is in front of the start pose so I can make sure every thing is correct so I can experiment with other goal pose.
I appreciate your help in making the rosbot move so I can complete my experiment.
Regards,