I create an urdf file for a robot with four special wheel sets, each set consists of two cylinders. Of the two cylinders, the upper one rotates around the z-axis, which drives the robot to turn, and the lower one is to drive the robot forward or backward (the picture below is a screenshot of this robot model). Now I want to make this robot move in gazebo. How to control such a robot in gazebo ?
Originally posted by stefanvan on ROS Answers with karma: 23 on 2018-10-02
Post score: 0
Original comments
Comment by kump on 2018-10-02:
Have you defined transmissions for every wheel already? http://gazebosim.org/tutorials/?tut=ros_control
Comment by stefanvan on 2018-10-03:
@kump The website you provided says "Currently only effort interfaces are implemented. (feel free to add more)". Is it feasible to use the effort interfaces to drive my robot?
Comment by kump on 2018-10-03:
Depends what you need. For wheels I have used the VelocityJointInterface and it works as expected, so far.
transmission_interface/SimpleTransmission
hardware_interface/VelocityJointInterface
Comment by kump on 2018-10-03:
Effort interface is good for setting position of the joint, so maybe you actually want that for the upper cylinders.
Comment by kump on 2018-10-03:
I found a nice list of possible controllers: http://wiki.ros.org/ros_control. I think I used the wrong controller. It makes more sense to use joint_velocity_controller from effort_controllers. That means: type: effort_controllers/JointVelocityController; hardwareInterface: EffortJointInterface;
Comment by stefanvan on 2018-10-04:
@kump If I set the transmission for each joint, and then write a yaml file to load multiple controllers onto the parameter server. This means that each controller controls its corresponding joint, then the controllers can't work cooperatively. How does the model move?
Comment by kump on 2018-10-04:
@jn-chen It moves exactly as a real robot. Either you have a motor for every wheel and you actuate every wheel by its own motor. Or multiple wheels are connected to a rod or something. The rod is actuated by a motor and the movement transfers to the wheels.
Comment by kump on 2018-10-04:
@jn-chen If you want two motors to actuate wheels with the same effort, you just send the same commands to both motors at the same time.
Comment by stefanvan on 2018-10-15:
@kump There are 4 wheel sets in my robot (as shown above), the upper wheels in each group are used for steering, and the lower wheels are used to move forward and backward. Do I need to set transmission for this total of 8 wheels?
Comment by stefanvan on 2018-10-15:
@kump And if so, should I set all the transmissions to EffortJointInterface
?
Comment by kump on 2018-10-15:
If you want to actuate all the wheels, then you need transmission tag for all the wheels. Think about it as this: The transmission assigns a motor to the wheel. So in the real robot, wherever there is a motor, there must be a transmission in the model.
Comment by kump on 2018-10-15:
I can imagine a model where the rear wheels do not have a motor and the whole model is in fact driven only by the front wheels. The rear wheels only follows wherever the front wheels are going. In that case you would need only 4 transmission tags. For both front wheels and for both front upper disks
Comment by kump on 2018-10-15:
You could assign all the transmissions' hardware interface to EffortJointInterface
, because it has implemented both JointPositionController
and JointPositionController
controller types. If you leave me your email, I can send you my Evernote note on ros_controllers with all the types listed.
Comment by stefanvan on 2018-10-15:
@kump My email address:[email protected] Thank you so much for your detailed instructions.
Comment by stefanvan on 2018-10-15:
Comment by stefanvan on 2018-10-16:
I just set 8 transmissions for all the joints, and then write a yaml file to load 4 controllers(for lower wheels) onto the parameter server. The types of these controllers are effort_controllers/JointEffortController
. Like you said, the upper wheels only follows wherever the lower wheels are going
Comment by stefanvan on 2018-10-16:
When executing command like rostopic pub -1 /vehicle_mover/controller_1/command std_msgs/Float64 "data: 0.5"&&rostopic pub -1 /vehicle_mover/controller_2/command std_msgs/Float64 "data: 0.5"
, the lower wheels just turned around and the robot didn't move forward.
Comment by stefanvan on 2018-10-16:
Comment by me_saw on 2020-07-06:
@stefanvan hope you have solved this
I'm working on similar kind of drive I cannot make it work, can your please share your work
Comment by kump on 2020-08-05:
Just regarding the pictures in this comment thread, the reason the robot in those pictures do not move forward is because the joint is set to rotate around the incorrect axis. You can see in in the first picture, there is a small arrow on the axis which is set as the axis of rotation. In the world coordinate system it is the z axis in those pictures. But you need the wheels to rotate in the y axis in order to move robot forward (assuming the standard robot coordinate system where x axis is aligned with the robot heading direction).
Comment by stefanvan on 2020-08-17:
@me_saw I did solve this, but I can't remember the exact method. Now I've found the catkin package, hope this can help you.
Comment by stefanvan on 2020-08-17:
@kump Thank you for still answering this question after so long, although I have forgotten many details of the question.
Comment by me_saw on 2020-08-17:
@stefanvan Thank you, I'll look into the package