Giter Club home page Giter Club logo

Comments (1)

KalanaRatnayake avatar KalanaRatnayake commented on September 17, 2024

Managed to fix it myself

Multirobot launch file

<launch>
    <!-- BEGIN ROBOT 1-->
    <group ns="rosbot1">
        <include file="$(find rosbot_description)/launch/single_rosbot.launch" >
            <arg name="init_pose" value="-x -10 -y -10 -z 0 -R 0 -P 0 -Y 0" />
            <arg name="tf_prefix" value="rosbot1"/>
        </include>
    </group>

    <!-- BEGIN ROBOT 2-->
    <group ns="rosbot2">
        <include file="$(find rosbot_description)/launch/single_rosbot.launch" >
            <arg name="init_pose" value="-x -10 -y 0 -z 0 -R 0 -P 0 -Y 0" />
            <arg name="tf_prefix" value="rosbot2"/>
        </include>
    </group>

    <!-- BEGIN ROBOT 2-->
    <group ns="rosbot3">
        <include file="$(find rosbot_description)/launch/single_rosbot.launch" >
            <arg name="init_pose" value="-x 0 -y -10 -z 0 -R 0 -P 0 -Y 0" />
            <arg name="tf_prefix" value="rosbot3"/>
        </include>
    </group>

</launch>

Robot instance launch file

<launch>
    <arg name="tf_prefix"/>
    <arg name="init_pose"/>

    <!-- Load the joint space controller -->
    <rosparam command="load" file="$(find joint_state_controller)/joint_state_controller.yaml" />
    <node name="joint_state_controller_spawner" pkg="controller_manager" type="spawner" output="screen" args="joint_state_controller" />

    <!-- load the model of the robot" -->
    <param name="robot_description" command="$(find xacro)/xacro '$(find rosbot_description)/urdf/rosbot.xacro' robot_namespace:=$(arg tf_prefix)"/>

    <!-- Spawn the robot_state_publisher with the desired tf_prefix -->
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" output="screen">
        <param name="tf_prefix" value="$(arg tf_prefix)"/>
    </node>

    <!-- Spawn the robot in the desired pose given by "init_pose" variable" -->
    <node name="rosbot_spawn" pkg="gazebo_ros" type="spawn_model" output="screen" args="$(arg init_pose) -urdf -param robot_description -model $(arg tf_prefix)"/>
    
    <node pkg="tf" type="static_transform_publisher" name="maplink" args="0 0 0 0 0 0 map $(arg tf_prefix)/map 100"/>
</launch>

from rosbot_ros.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.