Gazebo | Ignition | Community
Ask Your Question
0

Prismatic Joint not working properly with ROS2 & Gazebo 11

asked 2020-07-31 16:01:31 -0500

elementaryshr gravatar image

I posted this question on the ROS forum as well but as I still haven't found the answer, I'll repost it here.

I have been trying to make a robot model with a prismatic joint which moves in z axis. It has a lift link and uses joint state to actuate the motion. The whole setup worked great with ROS1 and loading robot description from .xacro files (x.urdf.xacro, x.transmission.xacro and x.gazebo.xacro) with spawn_urdf form gazebo_ros

However, when I started porting the robot model for ROS2, I soon discovered that this no longer works properly and I had to create a standalone sdf 1.5 file. I managed to get almost everything working in this format, except the prismatic lift joint. The lift platform keeps dropping to the floor if z axis unit vector is selected. If we use x or y axis, the platform is on the correct position, but sheers in x or y direction.

ROS2 Robot

This is the link to my robot's model in ROS2 and this is the robot description from ROS1.

I am using turtlebot3 and dolly as ideal examples of robots launching with gazebo in ROS2. The robot itself is based on turtlebot3 with 2x the size and additional lift joint.

What am I doing wrong here? Also, does anyone know any other ROS2 based gazebo models for such warehouse robots which I can refer to? Also, can we launch .xacro files using xacro plugin in ROS2?

Moreover, after investigation, I found out that if I disable gravity or apply any force which has an upward z component, the platform can go high up freely.

Thanks!

For reference: this is the video of my robot operating in ROS1

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2020-08-13 18:38:01 -0500

chapulina gravatar image

can we launch .xacro files using xacro plugin in ROS2?

Yes, xacro is available for Foxy. Here's an example using it.

x.transmission.xacro

I see your robot is using transmissions. These are not directly supported by Gazebo, they're used by ros_control and used by Gazebo through gazebo_ros_control. See how your ROS 1 robot is using that here.

ros_control hasn't been fully ported to ROS 2 yet. You can follow its development, and the development of the corresponding gazebo_ros2_control here:

What am I doing wrong here?

I believe the problem is trying to use ros_control. I recommend you use the gazebo_ros_force_system plugin instead. See a demo here.

edit flag offensive delete link more

Comments

1

Thanks a lot for the answer. The xacro example looks really interesting and I might try that in the future. For now, I was able to get the lift joint working using force system

ros2 service call /apply_joint_effort gazebo_msgs/srv/ApplyJointEffort '{joint_name: "lift_joint", effort: -2.0, start_time: {sec: 0, nanosec: 0}, duration: {sec: 2000, nanosec: 0} }'

elementaryshr gravatar imageelementaryshr ( 2020-08-14 16:38:53 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2020-07-31 16:01:31 -0500

Seen: 215 times

Last updated: Aug 13 '20