Contents
Environment
Gazebo Harmonic
Ros Iron (ros2)
Install Gazebo
https://gazebosim.org/docs/harmonic/install_ubuntu
sudo apt-get update
sudo apt-get install lsb-release wget gnupg
sudo wget https://packages.osrfoundation.org/gazebo.gpg -O /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
sudo apt-get update
sudo apt-get install gz-harmonic
Run Gazebo
# Start gazebo sim
gz sim -v 4 -r visualize_lidar.sdf
# Test control
gz topic -e -t /model/vehicle_blue/cmd_vel
gz topic -t /model/vehicle_blue/cmd_vel -m gz.msgs.Twist -p "linear: { x: 0.1 }โ
Install Ros gz bridge
ros topic: /model/vehicle_blue/cmd_vel
, Type geometry_msgs/msg/Twist
to
gz topic: /model/vehicle_blue/cmd_vel
, Type gz.msgs.Twist
sudo apt install ros-iron-ros-gzharmonic-bridge
ros2 run ros_gz_bridge parameter_bridge /model/vehicle_blue/cmd_vel@geometry_msgs/msg/Twist]gz.msgs.Twist
# Test
ros2 topic pub /model/vehicle_blue/cmd_vel geometry_msgs/Twist "linear: { x: 0.1 }โ
Install keyboard control
sudo apt install ros-iron-teleop-twist-keyboard
ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args -r /cmd_vel:=/model/vehicle_blue/cmd_vel
Rviz
Lidar Data
ros2 run ros_gz_bridge parameter_bridge /lidar2@sensor_msgs/msg/LaserScan[gz.msgs.LaserScan --ros-args -r /lidar2:=/laser_scan
tf
ros2 run ros_gz_bridge parameter_bridge /model/vehicle_blue/tf@tf2_msgs/msg/TFMessage[gz.msgs.Pose_V --ros-args -r /model/vehicle_blue/tf:=/tf
Start rviz
rviz2
Global Options
-> Fixed Frame
to vehicle_blue/lidar_link/gpu_lidar
https://docs.ros.org/en/iron/Tutorials/Advanced/Simulators/Gazebo/Gazebo.html
[fluentform id="8"]
binance referencnรญ bonus
Thanks for sharing. I read many of your blog posts, cool, your blog is very good.