ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Move_base doesn't subscribe to "/scan" topic from RpLidar

asked 2021-12-14 13:00:49 -0600

Hlezzaik gravatar image

updated 2021-12-14 15:03:21 -0600

Greetings,

I'm trying to configure move_base on a Jetson Nano board (Ubuntu 18.04, ROS Melodic) equipped with an RpLidar and ZED2 camera. The RpLidar provides the "/scan" topic which updates the local_costmap. Unfortunately, I can't get the "/scan" topic to get linked to move_base and I can't figure out how to link them both together.

I am following the tutorial on this page: move_base - ROS Wiki

Here are the config files for move_base on the jetbot:

Launch File:

<launch>
<!-- NODE1: ZED2 NODE CREATION -->
<arg name="svo_file"             default="" /> <!-- <arg name="svo_file" default="path/to/svo/file.svo"> -->
<arg name="stream"               default="" /> <!-- <arg name="stream" default="<ip_address>:<port>"> -->

<arg name="node_name"            default="zed_node" />
<arg name="camera_model"         default="zed2" />
<arg name="publish_urdf"         default="true" />

<arg name="camera_name"          default="zed2" />

<arg name="base_frame"           default="base_link" />

<arg name="cam_pos_x"             default="0.0" /> <!-- Position respect to base frame (i.e. "base_link) -->
<arg name="cam_pos_y"             default="0.0" /> <!-- Position respect to base frame (i.e. "base_link) -->
<arg name="cam_pos_z"             default="0.0" /> <!-- Position respect to base frame (i.e. "base_link) -->
<arg name="cam_roll"              default="0.0" /> <!-- Orientation respect to base frame (i.e. "base_link) -->
<arg name="cam_pitch"             default="0.0" /> <!-- Orientation respect to base frame (i.e. "base_link) -->
<arg name="cam_yaw"               default="0.0" /> <!-- Orientation respect to base frame (i.e. "base_link) -->

<group ns="$(arg camera_name)">
    <include file="$(find zed_wrapper)/launch/include/zed_camera.launch.xml">
        <arg name="camera_name"         value="$(arg camera_name)" />
        <arg name="svo_file"            value="$(arg svo_file)" />
        <arg name="stream"              value="$(arg stream)" />
        <arg name="node_name"           value="$(arg node_name)" />
        <arg name="camera_model"        value="$(arg camera_model)" />
        <arg name="base_frame"          value="$(arg base_frame)" />
        <arg name="publish_urdf"        value="$(arg publish_urdf)" />
        <arg name="cam_pos_x"           value="$(arg cam_pos_x)" />
        <arg name="cam_pos_y"           value="$(arg cam_pos_y)" />
        <arg name="cam_pos_z"           value="$(arg cam_pos_z)" />
        <arg name="cam_roll"            value="$(arg cam_roll)" />
        <arg name="cam_pitch"           value="$(arg cam_pitch)" />
        <arg name="cam_yaw"             value="$(arg cam_yaw)" />
    </include>
</group>

<remap from="/odom" to="/zed2/zed_node/odom"/>

<!-- NODE 2: RP_Lidar -->
<node name="rplidarNode"          pkg="rplidar_ros"  type="rplidarNode" output="screen">
<param name="serial_port"         type="string" value="/dev/ttyUSB0"/>
<param name="serial_baudrate"     type="int"    value="115200"/><!--A1/A2 -->
<param name="frame_id"            type="string" value="laser_frame"/>
<param name="inverted"            type="bool"   value="false"/>
<param name="angle_compensate"    type="bool"   value="true"/>
</node>

<!-- NODE 3: ROS Jetbot -->
<node name="jetbot_control_node" pkg="ros_jetbot" type="controll.py"/>

<!-- NODE 4: Move Base Wrapper (Configuration) -->
<node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find zed_move_base)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find zed_move_base)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find zed_move_base)/config/local_costmap_params.yaml" command="load" ns ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-12-14 18:38:15 -0600

miura gravatar image

It may be that observation_sources and plugins are not connected. You can probably subscribe with the following

Local_costmap_params.yaml:

global_frame: odom
robot_base_frame: base_link 
update_frequency: 6.0
publish_frequency: 5.0 
static_map: false
rolling_window: true 
width: 10.0
height: 10.0
resolution: 0.05

plugins:
 - {name: obstacles_laser,           type: "costmap_2d::ObstacleLayer"}
 - {name: inflation,                 type: "costmap_2d::InflationLayer"}

# add
obstacles_laser:
  observation_sources: laser_scan_sensor
  laser_scan_sensor: {sensor_frame: laser_frame, data_type: LaserScan, topic: scan, marking: true, clearing: true}
edit flag offensive delete link more

Comments

Thanks, I just tried that and it actually worked!!

Hlezzaik gravatar image Hlezzaik  ( 2021-12-15 12:52:47 -0600 )edit

@Hlezzaik I'm glad it worked out. Could you please click on the collect symbol to indicate that it is the correct answer?

miura gravatar image miura  ( 2021-12-15 18:04:03 -0600 )edit

Thank you, just did that.

I'm having a new problem now though, with the config files as above and adding the obstacles laser to the local costmap, I sense there's something missing for the global costmap.

I'm getting the following bugs whenever I tell the robot to go to a specific point:

Could not transform the global plan to the frame of the controller
The origin of the sensor at (1.68, 0.10) is out of map bounds. So, the costmap cannot raytrace for it. 
The goal sent to the navfn planner is off the global costmap. Planning will always fail to this goal.

Any suggestions?

Hlezzaik gravatar image Hlezzaik  ( 2021-12-16 11:16:37 -0600 )edit

Thank you for clicking.

I think that creating map information with gmapping or map_server and reflecting it to the global cost map may solve the problem. If you have additional questions, could you please create a new question page?

miura gravatar image miura  ( 2021-12-16 18:02:08 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2021-12-14 12:59:51 -0600

Seen: 134 times

Last updated: Dec 14 '21