0
$\begingroup$

Gazebo Answers logo

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


Originally posted by elementaryshr on Gazebo Answers with karma: 3 on 2020-07-31

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Gazebo Answers logo

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.


Originally posted by chapulina with karma: 7504 on 2020-08-13

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by elementaryshr on 2020-08-14:
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} }'
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.