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

Robot moves randomly using "velocity controller.launch" #6

Closed
AlvaroFerGar opened this issue Aug 14, 2018 · 10 comments
Closed

Robot moves randomly using "velocity controller.launch" #6

AlvaroFerGar opened this issue Aug 14, 2018 · 10 comments

Comments

@AlvaroFerGar
Copy link

Hello,

I roslaunched the velocity controller.launch file. I expected that the robot will spawn and remain static until I publish some commands in one of the topics. After this, I wanted to do something like driving the robot with a keyboard.

The topics seem to be fine and no error message is shown but the robot wheels appear to move randomly. I'm not sure if something(no idea what) went wrong or if this is the normal behavior. In both cases, I'd appreciate some help in order to make an initially static robot.

I'm working with ROS Kinetic and Gazebo 7.0 in Ubuntu 16.04LTS.

If it helps, here is the output in my terminal...

... logging to /home/alvaro/.ros/log/9f70ff16-9fb9-11e8-b83d-e4f89c846601/roslaunch-alvaro-Lenovo-B50-80-2717.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

xacro: Traditional processing is deprecated. Switch to --inorder processing!
To check for compatibility of your document, use option --check-order.
For more infos, see http://wiki.ros.org/xacro#Processing_Order
started roslaunch server http://alvaro-Lenovo-B50-80:43107/

SUMMARY
========
PARAMETERS
 * /open_base/back_joint_velocity_controller/joint: back_rim_joint
 * /open_base/back_joint_velocity_controller/pid/d: 0.0
 * /open_base/back_joint_velocity_controller/pid/i: 0.0
 * /open_base/back_joint_velocity_controller/pid/p: 0.001
 * /open_base/back_joint_velocity_controller/type: effort_controller...
 * /open_base/joint_state_controller/publish_rate: 100
 * /open_base/joint_state_controller/type: joint_state_contr...
 * /open_base/left_joint_velocity_controller/joint: left_rim_joint
 * /open_base/left_joint_velocity_controller/pid/d: 0.0
 * /open_base/left_joint_velocity_controller/pid/i: 0.0
 * /open_base/left_joint_velocity_controller/pid/p: 0.001
 * /open_base/left_joint_velocity_controller/type: effort_controller...
 * /open_base/parameter/control/I: 0.0005
 * /open_base/parameter/control/P: 5.0
 * /open_base/parameter/initial/theta: 0.0
 * /open_base/parameter/initial/x: 0.0
 * /open_base/parameter/initial/y: 0.0
 * /open_base/parameter/max/omega: 50.0
 * /open_base/parameter/max/v: 1.0
 * /open_base/parameter/stop/angle: 0.10471975512
 * /open_base/parameter/stop/distance: 0.001
 * /open_base/parameter/wheel/radius: 0.01905
 * /open_base/right_joint_velocity_controller/joint: right_rim_joint
 * /open_base/right_joint_velocity_controller/pid/d: 0.0
 * /open_base/right_joint_velocity_controller/pid/i: 0.0
 * /open_base/right_joint_velocity_controller/pid/p: 0.001
 * /open_base/right_joint_velocity_controller/type: effort_controller...
 * /open_base/robot_description: <?xml version="1....
 * /open_base/robot_state_publisher/publish_frequency: 30.0
 * /rosdistro: kinetic
 * /rosversion: 1.12.13
 * /use_sim_time: True

NODES
  /open_base/
    controller_spawner (controller_manager/spawner)
    kinematics (open_base/open_base_kinematics)
    main (open_base/open_base_main)
    odometry (open_base/open_base_odometry)
    open_base_spawner (gazebo_ros/spawn_model)
    robot_state_publisher (robot_state_publisher/robot_state_publisher)
  /
    gazebo (gazebo_ros/gzserver)
    gazebo_gui (gazebo_ros/gzclient)
  /open_base/sensor/
    encoder (open_base/open_base_sensor_encoder)

auto-starting new master
process[master]: started with pid [2731]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 9f70ff16-9fb9-11e8-b83d-e4f89c846601
process[rosout-1]: started with pid [2744]
started core service [/rosout]
process[gazebo-2]: started with pid [2747]
process[gazebo_gui-3]: started with pid [2752]
process[open_base/open_base_spawner-4]: started with pid [2757]
process[open_base/robot_state_publisher-5]: started with pid [2758]
process[open_base/controller_spawner-6]: started with pid [2763]
process[open_base/odometry-7]: started with pid [2765]
process[open_base/kinematics-8]: started with pid [2771]
[INFO] [1534248025.070493, 0.000000]: Controller Spawner: Waiting for service controller_manager/load_controller
process[open_base/sensor/encoder-9]: started with pid [2832]
process[open_base/main-10]: started with pid [2841]
[ INFO] [1534248026.020910859]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1534248026.021266355]: Finished loading Gazebo ROS API Plugin.
[ INFO] [1534248026.022992856]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
[ INFO] [1534248026.023358064]: waitForService: Service [/gazebo/set_physics_properties] has not been advertised, waiting...
Unhandled exception in thread started by
sys.excepthook is missing
lost sys.stderr
[open_base/open_base_spawner-4] process has finished cleanly
log file: /home/alvaro/.ros/log/9f70ff16-9fb9-11e8-b83d-e4f89c846601/open_base-open_base_spawner-4*.log
[ INFO] [1534248036.197523806, 0.021000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1534248036.218097102, 0.027000000]: waitForService: Service [/gazebo/set_physics_properties] is now available.
[ INFO] [1534248036.349280373, 0.072000000]: Physics dynamic reconfigure ready.
[ INFO] [1534248036.466072552, 0.109000000]: Physics dynamic reconfigure ready.

...and the created topics.

Published topics:
 * /gazebo/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /gazebo/model_states [gazebo_msgs/ModelStates] 1 publisher
 * /open_base/pose/mobile [geometry_msgs/Pose2D] 1 publisher
 * /gazebo/link_states [gazebo_msgs/LinkStates] 1 publisher
 * /rosout [rosgraph_msgs/Log] 7 publishers
 * /tf [tf2_msgs/TFMessage] 1 publisher
 * /gazebo_gui/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /tf_static [tf2_msgs/TFMessage] 1 publisher
 * /clock [rosgraph_msgs/Clock] 1 publisher
 * /open_base/pose/world [geometry_msgs/Pose2D] 1 publisher
 * /open_base/left_joint_velocity_controller/command [std_msgs/Float64] 1 publisher
 * /rosout_agg [rosgraph_msgs/Log] 1 publisher
 * /open_base/right_joint_velocity_controller/command [std_msgs/Float64] 1 publisher
 * /open_base/sensor/wheel_velocity [open_base/Velocity] 1 publisher
 * /gazebo_gui/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /open_base/back_joint_velocity_controller/command [std_msgs/Float64] 1 publisher
 * /gazebo/parameter_updates [dynamic_reconfigure/Config] 1 publisher

Subscribed topics:
 * /gazebo/set_model_state [gazebo_msgs/ModelState] 1 subscriber
 * /open_base/pose/mobile [geometry_msgs/Pose2D] 1 subscriber
 * /open_base/joint_states [sensor_msgs/JointState] 2 subscribers
 * /gazebo/set_link_state [gazebo_msgs/LinkState] 1 subscriber
 * /gazebo/link_states [gazebo_msgs/LinkStates] 1 subscriber
 * /rosout [rosgraph_msgs/Log] 1 subscriber
 * /clock [rosgraph_msgs/Clock] 8 subscribers
 * /open_base/pose/world [geometry_msgs/Pose2D] 2 subscribers
 * /open_base/command [open_base/Movement] 1 subscriber

And, finally, the robot is spawning with any color. Not sure if this is related to the main problem but it can be a clue to somebody.

Thanks in advance!!!

@GuiRitter
Copy link
Owner

Sorry for not answering before, I had no time in the last couple of days.

The wheels moving randomly happens with some controllers when they output an effort value that is below a certain threshold. I don't remember the exact details, but I think it shouldn't be happening.

In the last tests I made, I received some error messages regarding the controllers, but haven't looked at them. Although you wrote you got no error messages, it could be related.

I was trying to make the robot colored, but I don't remember right now in which cases it wasn't working. Another thing that I'll have to take a look.

Next time I have some time, I'll compare this project with another project I made that used this package, with some modifications, to see if I can make it work again. The other one I'm pretty sure should be working.

@AlvaroFerGar
Copy link
Author

First of all, don't be sorry for no answering in some hours! I didn't expect an instant response and it wasn't necessary.

I will take a look on the next days and post the solution to my problem if I find it. The color isn't a problem for me, I just mentioned it as a curios fact.

Thanks for the feedback!!

@GuiRitter
Copy link
Owner

No problem, it's just that I like to err on the side of politeness...

@GuiRitter
Copy link
Owner

Fixed in 7f78441! The problem is that the joints had a name in the description and a different name in the controller.

I also added some files in the script folder to make debugging easier. Just cd to that folder and source the *.sh files.

@AlvaroFerGar
Copy link
Author

Thank you very much for the update! I have tested and it works fine for me.
And thanks also for the *.sh files! They surely will make things easier for begineers (like me).

I also was thinking that the problem was in the joints names. What I made was changing the naming in rim.urdf.xacro to be equal with description.urdf. I didn't notice the joint_velocity.yaml, but it also has the same naming. The robot appear to be static with this changes but, as i didn't have time to test the movement, I didn't post anything in this issue.
So, in brief, I have the same joint naming in rim.urdf.xacro, description.urdf and joint_velocity.yaml and you keep the different naming in description.urdf. Is the description.urdf file irrelevant for the control?

As I said your code works perfectly. I only ask to understand the whole thing.
Thanks in advance!

@GuiRitter
Copy link
Owner

@AlvaroFerGar You're welcome!

About them *.sh files, they make my life easier too... It was getting pretty annoying doing it the other way.

Yeah, I didn't changed the names in the *.urdf because I stopped using it. I should have deleted the old description, but didn't because reasons. Shall be done in the future, if I don't forget about it.

About the color, I remembered something. Take a look here. It should be enough to give you some inspiration 😉.

Keep in mind I also remembered that something changed in a Linux library, libpng or something, that causes the colors to go haywire when viewing with RViz. It might be relevant.

@lanxzheng
Copy link

Thank you very much for the update! I have tested and it works fine for me.
And thanks also for the *.sh files! They surely will make things easier for begineers (like me).

I also was thinking that the problem was in the joints names. What I made was changing the naming in rim.urdf.xacro to be equal with description.urdf. I didn't notice the joint_velocity.yaml, but it also has the same naming. The robot appear to be static with this changes but, as i didn't have time to test the movement, I didn't post anything in this issue.
So, in brief, I have the same joint naming in rim.urdf.xacro, description.urdf and joint_velocity.yaml and you keep the different naming in description.urdf. Is the description.urdf file irrelevant for the control?

As I said your code works perfectly. I only ask to understand the whole thing.
Thanks in advance!

Hi~Maybe I meet the same problem with you, the car rotates clockwise along the yaw axis. Could you tell me your detailed solution? Thank you very much.

@20150388
Copy link

20150388 commented Dec 17, 2018 via email

@AlvaroFerGar
Copy link
Author

Hi~Maybe I meet the same problem with you, the car rotates clockwise along the yaw axis. Could you tell me your detailed solution? Thank you very much.

Hello @lanxzheng !

As I said, my main problem was that I had different names for the joints in the rim.urdf.xacro files (that describe the joints) and in the .yaml files (that link the joints with their controllers). This was solved by the creator in the last commit 7f78441. So I think that, if you downloaded the last commit, this shouldn't be your problem.

Hope it has helped!

@GuiRitter
Copy link
Owner

Hey I contact you a months ago to know how to move the robot with the keyboard. During the project I was able to find a solution to move the robot with a keyboard and a PS3 joystick , if you want I can send you the project. Thank for the support. Na(o) quarta, 15/08/2018, 11:49, Guilherme Alan Ritter < notifications@github.com> escreveu:

Sorry for not answering before, I had no time in the last couple of days. The wheels moving randomly happens with some controllers when they output an effort value that is below a certain threshold. I don't remember the exact details, but I think it shouldn't be happening. In the last tests I made, I received some error messages regarding the controllers, but haven't looked at them. Although you wrote you got no error messages, it could be related. I was trying to make the robot colored, but I don't remember right now in which cases it wasn't working. Another thing that I'll have to take a look. Next time I have some time, I'll compare this project with another project I made that used this package, with some modifications, to see if I can make it work again. The other one I'm pretty sure should be working. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#6 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AiQ3L3U4SzmYdsB6DVUzymob4FOAkPxHks5uQ_zXgaJpZM4V8XTZ .

I'm glad to hear you got it working!

I'm not working with keyboard or joypad control right now, but maybe it would be a good idea to make a repository with the solutions you found. You'll be able to help more people that way 😉.

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

No branches or pull requests

4 participants