nav2d troubles for params config
Hi everyone,
A few days ago, I decided to use nav2d
on my real robot for exploration using SLAM. The thing is, when I see the map on rviz it's very small and after I order the robot start mapping with rosservice call /StartMapping
, it starts moving forward and then turns forever.
I think everything is configurated in a good way, but something is missing. I've attached some useful info below in order you can see some inconsistency.
I've already configurated the odometry data which suscribes types messages geometrymsgs/Twist to /cmdvel topic, and publishes the speeds to /rpm topic. Then another file subscribes to rpm topic and interpret it readings based on odometry. For the kinect I'm using simply use freenect.launch and depth info, and the fake laser scan data publishes to /scan topic. So, I shouldn't have problems with that.
On the other hand, for nav2d I don't have a joystick, so set the orders through rosservice calls. By the way, I'm using tutorial3.launch
from the website. The params used are the following:
Operator.yaml
# Maximum velocity command the operator will send to the robot (in m/s)
max_velocity: 0.25 #1.0 [m/s] por defecto
# If set to true, the selected best direction is published as a GridCells-Message
publish_route: true #falso por defecto
# The way is assumed to be free when there is no obstacle within this range (in meter)
max_free_space: 2.0 #5.0 [m] por defecto
safety_decay: 0.95 # (0.95) 0.95 por defecto
# The importance weights of the 3 action values
distance_weight: 1 #1 por defecto
safety_weight: 2 #1 por defecto
conformance_weight: 1 #1 por defecto
continue_weight: 0 #1 por defecto
ros.yaml
###########################################################
# Defines topics services and frames for all modules
### TF frames #############################################
laser_frame: camera_link
robot_frame: base_link
odometry_frame: odom
offset_frame: offset
map_frame: map
### ROS topics ############################################
map_topic: map
laser_topic: scan
### ROS services ##########################################
map_service: static_map
navigator.yaml
# Inflation params used for path planning
map_inflation_radius: 0.5 # (1.0) 1.0 [m] por defecto
robot_radius: 0.3 # ojo que está repetido en costmap.yaml
# Tolerance in target position for MoveToPosition2D (meter)
navigation_goal_distance: 2.0 # 1.0 [m] por defecto
# Toleranvce in target heading for MoveToPosition2D (radians)
navigation_goal_angle: 1.0 # 1.0 [rad] por defecto
# Distance at which to turn off obstacle avoidance (meter)
navigation_homing_distance: 4.0 # 3.0 [m] por defecto
# Find new exploartion target when in range of current one (meter)
exploration_goal_distance: 3.0 # 3.0 [m] por defecto
# Strategy MinPos
min_target_area_size: 1.0
visualize_frontiers: true
#################### Agregados de nav2d_navigator#####################
robot_id: 1 # ID único para los robots en equipo
map_frame: map # map por defecto
#robot_frame: robot # por defecto. Comentado por tener nombre cambiado en ros.yaml
#map_service: get_map # por defecto. Comentado por también aparecer en ros.yaml y con nombre cambiado
exploration_strategy: NearestFrontierPlanner # Mismo nombre por defecto, no estaba
min_replanning_period: 3.0 # 3.0 [s] por defecto
min_replanning_period: 1.0 # 1.0 [s]´
mapper.yaml
### Mapper ################################################
grid_resolution: 0.025 # (0.1)
range_threshold: 10.0
map_update_rate: 5
publish_pose_graph: true
max_covariance: 0.01
transform_publish_period: 0.1
min_map_size: 20
### Localizer #############################################
min_particles: 2500
max_particles: 10000
### Karto #################################################
#Crea un mapa dado un ajuste de láser escaners. La implementación de Karlo es de un algoritmo se scan-matching de alto rendimiento que construye un mapa de escaneos individuales y los corrige en base a la odometría.
MinimumTravelDistance: 1.0 # defecto de 0.2 m
MinimumTravelHeading: 0.52 # defecto de 20° o radianes
LoopSearchMaximumDistance: 10.0
UseScanMatching: true
UseScanBarycenter: true
ScanBufferSize: 70
ScanBufferMaximumScanDistance: 20.0
UseResponseExpansion: false
DistanceVariancePenalty: 0.3
MinimumDistancePenalty: 0.5
AngleVariancePenalty: 20 # no seguro
MinimumAnglePenalty: 0.9
LinkMatchMinimumResponseFine: 0.6
LinkScanMaximumDistance: 5.0
CorrelationSearchSpaceDimension: 0.3
CorrelationSearchSpaceResolution: 0.01
CorrelationSearchSpaceSmearDeviation: 0.03
CoarseSearchAngleOffset: 20
FineSearchAngleOffset: 0.2
CoarseAngleResolution: 2
LoopSearchSpaceDimension: 8.0
LoopSearchSpaceResolution: 0.05
LoopSearchSpaceSmearDeviation: 0.03
LoopMatchMinimumChainSize: 10
LoopMatchMaximumVarianceCoarse: 0.16
LoopMatchMinimumResponseCoarse: 0.7
LoopMatchMinimumResponseFine: 0.7
costmap.yaml
global_frame: odom
robot_base_frame: base_link
update_frequency: 10.0 (5.0)
publish_frequency: 1.0
#set if you want the voxel map published
publish_voxel_map: true
#set to true if you want to initialize the costmap from a static map
static_map: false
#begin - COMMENT these lines if you set static_map to true
rolling_window: true
width: 15.0
height: 15.0
resolution: 0.05
#end - COMMENT these lines if you set static_map to true
map_type: costmap # tipo de mapa
track_unknown_space: true # seguir un espacio no conocido
transform_tolerance: 0.3 # tolerancia de transformadas en [s]
obstacle_range: 4.0 # máximo rango en [m] para insertar obstáculos usando el sensor de visión
min_obstacle_height: 0.0 # altura mínima obstáculos
max_obstacle_height: 2.0 # idem máxima
raytrace_range: 4.5 # máximo rango en [m] para quitar obstáculos
robot_radius: 0.3 # radio del robot en 0.3 [m]
inflation_radius: 0.2 # radio de inflación de obstáculos en [m]
cost_scaling_factor: 2.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}
tutorial3.launch
<launch>
<!-- Some general parameters -->
<param name="use_sim_time" value="false" />
<rosparam file="$(find nav2d_tutorials)/param/ros.yaml"/>
<!-- Start Stage simulator with a given environment
<node name="Stage" pkg="stage_ros" type="stageros" args="$(find nav2d_tutorials)/world/tutorial.world">
<param name="base_watchdog_timeout" value="0" />
</node> -->
<!-- Start the Operator to control the simulated robot -->
<node name="Operator" pkg="nav2d_operator" type="operator" >
<!-- <remap from="scan" to="base_scan"/> -->
<rosparam file="$(find nav2d_tutorials)/param/operator.yaml"/>
<rosparam file="$(find nav2d_tutorials)/param/costmap.yaml" ns="local_map" />
</node>
<!-- Start Mapper to genreate map from laser scans -->
<node name="Mapper" pkg="nav2d_karto" type="mapper">
<!-- <remap from="scan" to="base_scan"/> -->
<rosparam file="$(find nav2d_tutorials)/param/mapper.yaml"/>
</node>
<!-- Start the Navigator to move the robot autonomously -->
<node name="Navigator" pkg="nav2d_navigator" type="navigator">
<rosparam file="$(find nav2d_tutorials)/param/navigator.yaml"/>
</node>
<node name="GetMap" pkg="nav2d_navigator" type="get_map_client" />
<node name="Explore" pkg="nav2d_navigator" type="explore_client" />
<node name="SetGoal" pkg="nav2d_navigator" type="set_goal_client" />
<!-- Start the joystick-driver and remote-controller for operation-->
<!-- <node name="Joystick" pkg="joy" type="joy_node" /> -->
<node name="Remote" pkg="nav2d_remote" type="remote_joy" />
<!-- RVIZ to view the visualization
<node name="RVIZ" pkg="rviz" type="rviz" args=" -d $(find nav2d_tutorials)/param/tutorial3.rviz" /> -->
</launch>
I've attached a video video and more info tftree, rqtgraph and motor. My questions are, according to the video and parameters I have. What could be wrong?, maybe some publish rate, threshold, tolerance or odometry?.
EDIT 1: I realize the problem resides on the encoders reading. Specifically in the encoders pulse I put, so this question would be solved. I'll open another post for that.
Asked by gerson_n on 2017-10-12 08:56:57 UTC
Comments
Great gerson_n, btw, what's materials do you refer when you change the parameters? Looking forward the result of you test.
Asked by l_a_den on 2017-10-13 03:49:59 UTC
It was the encoder's pulse I'm using, which are these https://www.pololu.com/product/2827. And also I'm currently trying to enhance the motors performance. By the moment, only low velocities seems work. I sucessfully achieve Startmapping call, and Exploration works, but I've made few tests so far.
Asked by gerson_n on 2017-10-13 09:56:07 UTC
By now I'm not secure if this really works, because I'm testing it. And regarding to the parameters I refered, were the ones inside controlador_de_motor.ino
Asked by gerson_n on 2017-10-13 09:59:36 UTC