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

Add ros_control to the simulation #28

Merged
merged 1 commit into from
Apr 9, 2023
Merged

Add ros_control to the simulation #28

merged 1 commit into from
Apr 9, 2023

Conversation

stevendes
Copy link
Member

Summary

This PR:

  • Adds the gazebo_ros_control package (automatically installed in the build process since is a dependency)
  • Add a config file for the PID values for Gazebo ROS control
  • Add a launch file for teleop the robot

Known issue

The PID values are set to p=1 because higher values make the robot crash, after doing some testing it seems that higher mass on the base solves the issue, indicating that maybe something in the inertia part is not behaving correctly.

The inertia matrix used seems correct, but the value itself mass=0.8 seems too light for the controller to work properly, I would like to know if this value is correct and is accounting to the rest of the components (battery, board, etc).

A higher mass allows the PID to be tuned and the robot to work much better using teleop.

Image of the Robot in crashed state:

Screenshot from 2023-03-26 21-40-26

@francocipollone
Copy link
Collaborator

seems too light for the controller to work properly, I would like to know if this value is correct and is accounting to the rest of the components (battery, board, etc).

@jballoffet Do you know how much the carpincho weighs? 😄

@jballoffet
Copy link
Member

seems too light for the controller to work properly, I would like to know if this value is correct and is accounting to the rest of the components (battery, board, etc).

@jballoffet Do you know how much the carpincho weighs? smile

Just measured its weight! Approx 500gr. 🚀

Copy link
Collaborator

@francocipollone francocipollone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Great job!

I haven't tried this locally yet! Let me know when you consider it is good to be tried given the issue above described

Comment on lines 22 to 27
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
</plugin>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Just for the sake of the documenting, can you add the following?

Suggested change
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
</plugin>
<plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
<!-- <robotNamespace>: The ROS namespace to be used for this instance of the plugin, defaults to robot name in URDF/SDF
<!-- <controlPeriod>: The period of the controller update (in seconds), defaults to Gazebo's period -->
<!-- <robotParam>: The location of the robot_description (URDF) on the parameter server, defaults to /robot_description' -->
<!-- <robotSimType>: The pluginlib name of a custom robot sim interface to be used, defaults to 'DefaultRobotHWSim' -->
</plugin>

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@stevendes
Copy link
Member Author

stevendes commented Apr 4, 2023

@francocipollone I added your request and changed the mass to a bigger one as we previously discussed, is it good to give it a try!

The instructions are:

Run the simulation

roslaunch carpincho_simulation bringup.launch

Run teleop (NOTE: High values of velocity commands can make Gazebo crash, this could be avoided by limiting the velocity in the control configuration file, but since is code for the real robot I didn't touch it)

roslaunch carpincho_bringup teleop.launch

Copy link
Collaborator

@francocipollone francocipollone left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

I tried it locally and I noted the crashing. When turning and moving forward gazebo crashes (without modifying the values of teleop)

Can you create an issue and provide information about what you found so it can be solved in the future?

@stevendes stevendes merged commit f813135 into main Apr 9, 2023
@francocipollone francocipollone deleted the add_ros_control branch June 5, 2023 00:21
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

Successfully merging this pull request may close these issues.

None yet

3 participants