Skip to content

Attach camera to robot model #56

Description

@diebengay

Hello! I have a robot model in gazebo. How can I attach the camera instance to my robot using urdf? I have tried it copying the content of realsense_urdf.launch:

<param
    name="robot_description"
    command="$(find xacro)/xacro '$(find realsense_gazebo_plugin)/urdf/rs200_simulation.xacro'"
/>
<node
    name="spawn_model"
    pkg="gazebo_ros"
    type="spawn_model"
    args="-urdf -param robot_description -model rs200"
/>
<node name="state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>

in the simulation.launch of my project where I spawn the robot, and I created the camera instance too in the model.xacro of the robot:

<!-- Import macro for realsense-RS200 camera-->
<xacro:include filename="$(find realsense_gazebo_plugin)/urdf/realsense-RS200.macro.xacro"/>
<!-- Create camera instance -->
<xacro:realsense-rs200 prefix="" parent="base_link">
    <origin xyz="0 0 1.0" rpy="0 0 0" />   
</xacro:realsense-rs200>

but it doesn't link to the robot and spawns in a separated model called rs200. If I replace the rs200 in this line

args="-urdf -param robot_description -model rs200"

by the name of my robot model, the camera appears but the robot not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions