Commandeering Gazebo Simulation
"Containing all the needs to build a gazebo simulation"
For better look check this note, please visit HackMD.io
by:
Liber Normous
Tutorial from scratch part 1
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- http://gazebosim.org/tutorials/?tut=ros_control
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
-
- Create gazebo simulation package.
-
- Create
gazebo_launch.launch
file that includes:
- Setting some parameters.
- Passing that parameter to open
world
file.
- Put in a single
.launch
file.
Creating parts using FreeCAD
STEPS:
- Create model.
- Add center of mass tools.
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Move the origin of the object to center of mass.
- Add
FCInfo
to FreeCAD to analyze Inertia etc. https://www.youtube.com/watch?v=gThQk-4p1CY
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
- Tools Mebu Bar
- Addon manager
- Macros TAB
- Install FCInfo
- Macros Menu Bar
- FCInfo.FCMacro
- Execute
- Set the object density ()
- Check
Moment of inertia with mass
- Save to spreadsheed
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Create URDF File
TEMPLATE:
Tutorial:
NOTE:
MESH
needs FILENAME
attributes. <mesh filename="/media/zee/53FC06C50A4891B9/Project/m-43-commadeering_gazebo/obstacles-box.dae"/>
Check teh URDF FILE:
Example of URDF file, 1 object, no joints:
Create SDF file (does not work on RVIZ)
Template and Tutorial: http://gazebosim.org/tutorials?tut=build_model
Terminal functionality
Spawning object using gazebo
package
Services: Create and destroy models in simulation
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
NOTE:
model_xml
is the file. not the path
Deleting object gazebo
package
Services: Create and destroy models in simulation
Image Not Showing
Possible Reasons
- The image file may be corrupted
- The server hosting the image is unavailable
- The image path is incorrect
- The image format is not supported
Learn More →
Teleporting object to other location
NOTE:
- This is affecting the odometry reading!
- Set the position and orientation. Not the TWIST. Twist will be overwritten by
/cmd_vel
MATLAB add, delete, move, getting states of models
NOTE:
- This methods are inside a class. That is why we have
obj.
on every variables.
model_state
input is in format of
Add model
Preparing variables:
Calling a ROS service:"
- Object is always drop from 1m above for simplicity
How to read URDF file into string in MATLAB
Delete a model
Preparing variables:
Calling a ROS service:"
Get model states
NOTE:
- We Get states not from service. But from Subscribing into a topic.
- This is done because we need to update the states everytime and the easiest way is using
callback
function.
- Callback function will update the states whenever there is a state change.
- Iside the callback function
delay
or pause
is necessary. ¯\_(ツ)_/¯
.
Preparing variables:
Extracting message from the topic:
Call back function:
Move a model
NOTE
- Moving here is limited to dirrection for simplicity.
- To move, we need to know the current axis position value.
- We get axis position value from subscribing to
'/gazebo/model_states'
.
Preparing variables:
Calling a ROS service:"


