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

Gazebo plugin #1453

Closed
sayyidabeegam opened this issue Oct 16, 2020 · 14 comments
Closed

Gazebo plugin #1453

sayyidabeegam opened this issue Oct 16, 2020 · 14 comments
Labels

Comments

@sayyidabeegam
Copy link

Hello
I want to use D435 with my robot manipulator.
But I don't get any idea to integrate the sensor with my manipulator.
My requirements are
1. I want to attach the D435 with my manipulator's base link
2. want to launch with my manipulator package
3. want to use all available sensor data format.

Please help me to figure it out..
Thanks in advance

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Oct 16, 2020

Hi @sayyidabeegam There is a Gazebo plugin for D435 and ROS at the link below.

https://github.com/pal-robotics/realsense_gazebo_plugin

Instructions for setting it up this plugin are here:

pal-robotics/realsense_gazebo_plugin#7

A wider discussion about Gazebo plugins for RealSense is here:

#1170

I hope that these resources will be a useful starting point for you. Please do let me know of any follow-up questions that you have after reviewing the information. Thanks!

@sayyidabeegam
Copy link
Author

sayyidabeegam commented Oct 16, 2020

Is it applicable only for ROS2?
I am using ROS 1 and by following this instruction I am getting error
RLException:
Param xml is param command="$(find xacro)/xacro $(arg model)" name="$(arg robot_name)/robot_description"/
The traceback for the exception was written to the log file

@MartyG-RealSense
Copy link
Collaborator

realsense_gazebo_plugin is based on the earlier SyrianSpock Gazebo plugin that worked with ROS1 Melodic, so I would think that the updated one should be Melodic compatible too.

https://github.com/SyrianSpock/realsense_gazebo_plugin

@MartyG-RealSense
Copy link
Collaborator

Hi @sayyidabeegam Do you still require assistance with this case, please? Thanks!

@sayyidabeegam
Copy link
Author

sayyidabeegam commented Oct 23, 2020

yes
it is still not working
I have followed the given link
(pal-robotics/realsense_gazebo_plugin#7 (comment))

@sayyidabeegam
Copy link
Author

sayyidabeegam commented Oct 23, 2020

XML parsing error: mismatched tag: line 465, column 2
when processing file: /home/sayyida/interbotix_ws/src/interbotix_ros_arms/interbotix_descriptions/urdf/rx150.urdf.xacro

Check that:

  • Your XML is well-formed
  • You have the xacro xmlns declaration: xmlns:xacro="http://www.ros.org/wiki/xacro"
    RLException: Invalid tag: Cannot load command parameter [rx150/robot_description]: command [['/opt/ros/melodic/lib/xacro/xacro', '/home/sayyida/interbotix_ws/src/interbotix_ros_arms/interbotix_descriptions/urdf/rx150.urdf.xacro', 'robot_name:=rx150', 'use_world_frame:=true', 'use_default_gripper_bar:=true', 'use_default_gripper_fingers:=true', 'external_urdf_loc:=', 'load_gazebo_configs:=false']] returned with code [2].

Param xml is
The traceback for the exception was written to the log file

This error is coming when I attach the realsense with my arm.

@MartyG-RealSense
Copy link
Collaborator

MartyG-RealSense commented Oct 23, 2020

Have you downloaded the two files in the links below and put those two files in the package inside the urdf folder where you want your RealSense camera to be simulated?

I wanted to make sure that you had managed to download them as the formatting of the file download links in the linked-to instructions were badly broken in my own web browser.

https://github.com/pal-robotics-forks/realsense/blob/upstream/realsense2_description/urdf/_d435.gazebo.xacro

https://github.com/pal-robotics-forks/realsense/blob/upstream/realsense2_description/urdf/_d435.urdf.xacro

Then follow the rest of the instructions, which I have edited slightly for ease of reading.

Step 1
Edit the file _d435.urdf.xacro and change line 13 from:

<xacro:include filename="$(find realsense2_description)/urdf/urdf_d435.gazebo.xacro"/>
to

<xacro:include filename="$(find packagename)/urdf/urdf_d435.gazebo.xacro"/>

Step 2
In the urdf file where you want to use the simulated RealSense, add the following code, while again replacing packagename with the name of the package you are using. and baselink with the link where you want the RealSense camera to be joint on.

<xacro:include filename="$(find packagename)/urdf/_d435.urdf.xacro" />
<sensor_d435 parent="${prefix}base_link">
</sensor_d435>

Step 3
When you launch the file which uses this urdf model, you will find the simulated RealSense and you should see rostopics like /camera/color/image_raw

@sayyidabeegam
Copy link
Author

Still error is there

roslaunch interbotix_descriptions description.launch robot_name:=rx150 jnt_pub_gui:=true
... logging to /home/sayyida/.ros/log/179fbebe-15c9-11eb-a4c9-fef9b612eb5e/roslaunch-sayyida-11428.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

Deprecated: xacro tag 'sensor_d435' w/o 'xacro:' xml namespace prefix (will be forbidden in Noetic)
when processing file: /home/sayyida/interbotix_ws/src/interbotix_ros_arms/interbotix_descriptions/urdf/rx150.urdf.xacro
Use the following command to fix incorrect tag usage:
find . -iname "*.xacro" | xargs sed -i 's#<([/]?)(if|unless|include|arg|property|macro|insert_block)#<\1xacro:\2#g'

Not enough blocks
when instantiating macro: sensor_d435 (/home/sayyida/interbotix_ws/src/interbotix_ros_arms/interbotix_descriptions/urdf/_d435.urdf.xacro)
in file: /home/sayyida/interbotix_ws/src/interbotix_ros_arms/interbotix_descriptions/urdf/rx150.urdf.xacro
RLException: Invalid tag: Cannot load command parameter [rx150/robot_description]: command [['/opt/ros/melodic/lib/xacro/xacro', '/home/sayyida/interbotix_ws/src/interbotix_ros_arms/interbotix_descriptions/urdf/rx150.urdf.xacro', 'robot_name:=rx150', 'use_world_frame:=true', 'use_default_gripper_bar:=true', 'use_default_gripper_fingers:=true', 'external_urdf_loc:=', 'load_gazebo_configs:=false']] returned with code [2].

Param xml is
The traceback for the exception was written to the log file
NB:There is no problem with arm package Independently. The error come only after giving the realsense plugin

@MartyG-RealSense
Copy link
Collaborator

I do not have any personal experience with Gazebo or the RealSense gazebo plugin in particular, so I had to rely on references created by others. The best references that I could find were these two links:

https://roboticsknowledgebase.com/wiki/tools/gazebo-simulation/
https://answers.ros.org/question/348331/realsense-d435-gazebo-plugin/

@MartyG-RealSense
Copy link
Collaborator

Hi @sayyidabeegam Do you still require assistance with this case, please? Thanks!

@sayyidabeegam
Copy link
Author

No

@MartyG-RealSense
Copy link
Collaborator

Thanks very much for the update!

@rickstaa
Copy link

rickstaa commented Dec 1, 2020

For future reference here is an example package on how to use this plugin with gazebo and ROS, might people need it. A detailed explanation video created by @issaiass can be found here.

@MartyG-RealSense
Copy link
Collaborator

Awesome, thanks so much @rickstaa for sharing the resources with the RealSense community!

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

No branches or pull requests

3 participants