Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example launch file #27

Open
oscar-lima opened this issue Dec 6, 2017 · 0 comments
Open

Example launch file #27

oscar-lima opened this issue Dec 6, 2017 · 0 comments

Comments

@oscar-lima
Copy link
Collaborator

You can use this as an example launch file for your projects, it has a bit of most common features used in launch file programming/design:

<?xml version="1.0"?>
<launch>

    <!-- load values from shell environment variables (check your bashrc and make sure both ROBOT and ROBOT_ENV are set) -->
    <arg name="robot" default="$(optenv ROBOT !!ROBOT env NOT SET!!)" />
    <arg name="robot_env" default="$(optenv ROBOT_ENV !!ROBOT_ENV env NOT SET!!)" />

    <!-- common navigation launch files -->
    <include file="$(find mbot_2dnav)/ros/launch/nav_common.launch">
        <arg name="robot_env" value="$(arg robot_env)" />
    </include>

    <node pkg="move_base" type="move_base" respawn="true" name="move_base" output="screen">
        <param name="base_local_planner" value="dwa_local_planner/DWAPlannerROS" />
        <rosparam file="$(find mbot_2dnav)/ros/config/dwa/move_base_params.yaml" command="load" />
        <rosparam file="$(find mbot_bringup)/ros/config/$(arg robot)/robot_footprint.yaml" command="load"/>
        
        <rosparam file="$(find mbot_2dnav)/ros/config/dwa/costmap_common_params.yaml" command="load" ns="global_costmap"/>
        <rosparam file="$(find mbot_bringup)/ros/config/$(arg robot)/robot_footprint.yaml" command="load" ns="global_costmap"/>
        <rosparam file="$(find mbot_2dnav)/ros/config/dwa/global_costmap_params.yaml" command="load" />
        
        <rosparam file="$(find mbot_2dnav)/ros/config/dwa/costmap_common_params.yaml" command="load" ns="local_costmap" />
        <rosparam file="$(find mbot_bringup)/ros/config/$(arg robot)/robot_footprint.yaml" command="load" ns="local_costmap"/>
        <rosparam file="$(find mbot_2dnav)/ros/config/dwa/local_costmap_params.yaml" command="load" />    

        <rosparam file="$(find mbot_2dnav)/ros/config/dwa/dwa_local_planner_params.yaml" command="load" ns="DWAPlannerROS" />
        
        <!-- Upload recovery behavior parameters-->    
        <rosparam file="$(find mbot_2dnav)/ros/config/recovery_behaviors/force_field_parameters.yaml" command="load" ns="force_field_recovery"/>    
        <rosparam file="$(find mbot_2dnav)/ros/config/recovery_behaviors/clear_costmap_parameters.yaml" command="load" ns="clear_costmap_recovery"/>    

        <!-- Remap cmd_vel to a medium priority to allow joypad override control + publish constantly for some small amount of time -->
        <remap from="cmd_vel" to="/cmd_vel_constant"/>
        <remap from="~force_field_recovery/cmd_vel" to="/cmd_vel_prio_medium"/>
    </node>

</launch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant