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

Attach camera to robot model #56

Open
diebengay opened this issue May 13, 2020 · 1 comment
Open

Attach camera to robot model #56

diebengay opened this issue May 13, 2020 · 1 comment

Comments

@diebengay
Copy link

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.

@iqedgarmg
Copy link

iqedgarmg commented Nov 23, 2020

I had the same issue, and I solved it by modifying the line of the launch file:

command="$(find xacro)/xacro '$(find realsense_gazebo_plugin)/urdf/rs200_simulation.xacro'"

to my robot model (with the camera instance):

command="$(find xacro)/xacro '$(find my_package)/urdf/my_model.xacro'"

And everything works fine.

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

2 participants