Robotics StackExchange | Archived questions

Navigation stack problems

Hello everyone, I'm trying to create a navigation stack to create an autonomous AGV for docking. Currently I finished the tutorial on ROS page, but still got a lot problems with setting correct configuration of it. Here are main files that I created:

ROSLAUNCH:

<?xml version="1.0" encoding="UTF-8"?>
<launch>
<arg name = "robot_name" default = "vc200" />
<include file="$(find rosserial_server)/launch/socket.launch" />
<node name = "rplidarNode" pkg = "rplidar_ros" type = "rplidarNode" output = "screen">
<param name = "serial_port" type = "string" value = "/dev/ttyRPLIDAR0" />
<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>
<node pkg="tf" type="static_transform_publisher" name="map_to_odom" 
args="0.0 0.0 0.0 0 0 0.0 /map /odom 40" />
<node pkg="tf" type="static_transform_publisher" name="odom_to_basefootprint" 
    args="0.0 0.0 0.0 0 0 0.0 /odom /base_footprint 40" />
<node pkg="tf" type="static_transform_publisher" name="base_footprint_to_base_link"
args="0 0.0 0 0.0 0.0  0.0 /base_footprint /base_link 40" />
<node pkg="tf" type="static_transform_publisher" name="base_link_to_laser_frame"
args="0.2245 0.0 0 1.57 3.14  0.0 /base_link /laser 40" />
<node pkg = "navstack_pub" type = "wheel_odom.py"  name = "odom_to_base_link" output = "screen" />
<!--
<remap from="imu_data" to="IMU" />
<node pkg="robot_pose_ekf" type="robot_pose_ekf" name="robot_pose_ekf">
<param name="output_frame" value="odom"/>
<param name="base_footprint_frame" value="base_link"/>
<param name="freq" value="30.0"/>
<param name="sensor_timeout" value="1.0"/>
<param name="odom_used" value="true"/>
<param name="imu_used" value="true"/>
<param name="vo_used" value="false"/>
<param name="gps_used" value="false"/>
<param name="debug" value="false"/>
<param name="self_diagnose" value="false"/>
</node>
-->
<!--<node pkg = "rviz" type = "rviz" name = "rviz" />
 -->
  <node pkg="navstack_pub" type="rviz_2d" name="rviz_2d">
  </node>
  <!--<arg name = "map_file" default = "$(find navstack_pub)/maps/my_map.yaml" />
  -->
  <node pkg = "map_server" name = "map_server" type = "map_server" args = "$(find navstack_pub)/maps/my_map.yaml" />

 <include file = "$(find amcl)/examples/amcl_diff.launch" />

<node pkg = "move_base" type = "move_base" respawn = "false" name = "move_base" output = "screen" >
<rosparam file = "$(find navstack_pub)/param/costmap_common_params.yaml" command = "load" ns = "global_costmap" />
<rosparam file = "$(find navstack_pub)/param/costmap_common_params.yaml" command = "load" ns = "local_costmap" />
<rosparam file = "$(find navstack_pub)/param/local_costmap_params.yaml" command = "load" ns = "local_costmap" />
<rosparam file = "$(find navstack_pub)/param/global_costmap_params.yaml" command = "load" ns = "global_costmap" />
<rosparam file = "$(find navstack_pub)/param/base_local_planner_params.yaml" command = "load" />
 </node>
   </launch>

globalcostmapparams.yaml

 global_costmap: 
 global_frame: /map
 robot_base_frame: base_link

 update_frequency: 5.0
 publish_frequency: 0.0

 static_map: true
 rolling_window: false

 footprint_padding: 0.02

localcostmapparams.yaml

local_costmap:
publish_voxel_map: true

 global_frame: odom
 robot_base_frame: base_link

 update_frequency: 5.0
 publish_frequency: 2.0

 static_map: false
 rolling_window: true
 width: 6.0
 height: 6.0
 resolution: 0.025
 origin_x: 0.0
 origin_y: 0.0

baselocalplanner_params.yaml

TrajectoryPlannerROS:
acc_lim_th: 3.2 
acc_lim_x: 2.5
acc_lim_y: 2.5

max_vel_x: 0.65
min_vel_x: 0.1
max_rotational_vel: 1.0
min_in_place_rotational_vel: 0.4

escape_vel: -0.1

holonomic_robot: true

y_vels: [-0.3, -0.1, 0.1, -0.3]

xy_goal_tolerance: 0.1
yaw_goal_tolerance: 0.05

sim_time: 1.7
sim_granularity: 0.025
vx_samples: 3
vtheta_samples: 20

goal_distance_bias: 0.8
path_distance_bias: 0.6
occdist_scale: 0.01
heading_lookahead: 0.325

dwa: true
oscillation_reset_dist: 0.05

prune_plan: true
meter_scoring: true

costmapcommonparams.yaml

origin_z: 0.0
z_resolution: 0.2
z_voxels: 10
unknown_threshold: 9
mark_threshold: 0

transform_tolerance: 0.3

obstacle_range: 2.5
max_obstacle_height: 2.0
raytrace_range: 3.0

footprint: [[-0.325, -0.325], [-0.325, 0.325], [0.325, 0.325], [0.46, 0.0], [0.325, -0.325]]
footprint_padding: 0.01

inflation_radius: 0.55
cost_scaling_factor: 10.0

lethal_cost_threshold: 100

observation_sources: laser_scan_sensor

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

The main problem is when I want to set goals in rviz. I don't know how to change position on my robot in map. Currently it looks like this: image description

After sending the goal I have got lots of bugs. These are main one:

I know that is a lot of information and for sure I did not write everything so please write a comment if you got any question.

Asked by Heqas on 2022-09-17 05:40:19 UTC

Comments

Answers