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

How to move right and left wheel separately? #2

Open
jossichrist opened this issue Jan 14, 2018 · 5 comments
Open

How to move right and left wheel separately? #2

jossichrist opened this issue Jan 14, 2018 · 5 comments

Comments

@jossichrist
Copy link

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.

@eborghi10
Copy link
Owner

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

@jossichrist
Copy link
Author

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

@eborghi10
Copy link
Owner

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.

@jossichrist
Copy link
Author

jossichrist commented Feb 27, 2018

@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?

@eborghi10
Copy link
Owner

eborghi10 commented Feb 27, 2018

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.

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

No branches or pull requests

2 participants