my_ROS_mobile_robot icon indicating copy to clipboard operation
my_ROS_mobile_robot copied to clipboard

How to move right and left wheel separately?

Open jossichrist opened this issue 6 years ago • 5 comments

Hi! how do i move right and left wheel sparately? i have tried this command:

rostopic pub -1 /my_robot/rightWheel_effort_controller/command std_msgs/Float64 "data: 10" but it doesnt work.

jossichrist avatar Jan 14 '18 07:01 jossichrist

Hi, sorry for the late response. What are you testing? The Gazebo simulation or the robot?

eborghi10 avatar Feb 25 '18 04:02 eborghi10

Hi @eborghi10 . I am working on both, but i still can't find the idea. my mobile robot will be moved by using trajectory planning, which is jacobian will move the right and left wheels separately.

Is there any idea? for gazebo simulation and the hardware. im new in ROS, but i have read "AGITR"

Regards, jossichrist

jossichrist avatar Feb 25 '18 05:02 jossichrist

For the real robot, here are the lines where I declared the subscribers. You can send them velocities directly.

Instead, if you want to use Gazebo using roslaunch my_robot_gazebo my_robot_world.launch, there a topic called /my_robot/cmd_vel that moves the robot but you can't do it directly.

eborghi10 avatar Feb 26 '18 20:02 eborghi10

@eborghi10 , first of all, i want to thank you because your help this far as im a newbie in ROS and gazebo.

  1. for hardware question :
  • does the program that you mention above (motor.h) will be compatible with all peripheral component? my robot is using a. arduino mega b. motor dc 6v c. l298 motor dc driver d. HCTL (high precisision encoder)

  • im still confusing how to use the subscriber, i mean, i should control the motor A and motor B using PWM by a certain sampling time. is it possible?

  1. for software so, the conclusion is that in gazebo i cannot move wheels individually? i mean, i only can control the angular and rotation speed instead?

jossichrist avatar Feb 27 '18 01:02 jossichrist

Well, first of all, if you want to use your own hardware you will need to modify some parts of the arduino_peripherals program. There is no need to edit hardware_interface or ros_control·

Take a look at the new notes I made so you could understand better what I've done at the hardware level. It's very likely that you will need to modify this file in order to have support for HCTL. Maybe there are examples on GitHub about how to use it with Arduino.

The Arduino code takes care of the PWM signals, they are generated automatically. You only need to set an integer value which is proportional to the velocity. There could be an occasion in that your motors don't move even if you are sending velocities to them. In this case, you could try increasing the velocity because you're setting a low value.

Yes, that's right.

eborghi10 avatar Feb 27 '18 02:02 eborghi10