Code Monkey home page Code Monkey logo

air_systemtwizy's Introduction

air_systemTwizy

This repository contains the Central codebase for the AIR team's sd_twizy vehicle, encompassing both simulation models and real-world implementation using ROS2.

Twizy in the gazebo city

Usage

Prerequisites

Install Docker

Ensure that Docker is installed on your system. You can download it from the official Docker website. Docker compose is also required, and you can install it by following the instructions on the official Docker Compose website.

Installation

Step 1: Clone the repository

Clone the air_systemTwizy repository to your local machine using the following command:

git clone https://github.com/alunos-pfc/air_systemTwizy.git --recursive

Step 2: Build the Docker image

Navigate to the cloned directory and build the Docker image with the provided Dockerfile:

cd air_systemTwizy
docker build -t air-twizy -f docker/Dockerfile .

Running the Simulation

Step 1: Start the Simulation

To start the simulation using docker, run the following command setting the desired parameters:

./run.sh RVIZ=true GPU=false PROJECTION=true

The run.sh script allows you to set certain environment variables that control the behavior of the Docker container. You can set these variables by passing arguments to the script in the format KEY=value. The supported variables are:

  • GPU: Allows the user to run the PointCloud Process Plugin with GPU usage. Default value is set to false
  • RVIZ: Open Ros Visualization Tool. Default value is set to false.
  • PROJECTION: Enables the projection pf the point cloud in 2D. Default value is set to false.
  • WORLD_NAME: The name of the world file to be used in the simulation. Default value is set to ufg_default.world.
  • FOV_UP: Field of view up. Default: 15.0 degrees.
  • FOV_DOWN: Field of view down. Default: -15.0 degrees.
  • WIDTH: Width of the projection. Default: 440 pixels, due to gazebo limitations.
  • HEIGHT: Height of the projection. Default: 16 pixels, due the VLP-16 configuration.

Step 2: Control the vehicle

Once the simulation has started, press play in the Gazebo window.

Open another terminal outside the container and inside the air_systemTwizy directory. Then execute:

./bash_container.sh

Then You can control the vehicle using the keyboard running:

ros2 run vehicle_control teleop_keyboard.py

Follow the instructions bellow to control the vehicle:

flowchart TB
    Start(("Start")) --> |"↑ W"| IncreaseVelocity[("Increase Velocity")]
    Start --> |"↓ S"| DecreaseVelocity[("Decrease Velocity")]
    Start --> |"← A"| TurnLeft[("Turn Left")]
    Start --> |"→ D"| TurnRight[("Turn Right")]
    Start --> |" X"| Stop[("Stop Vehicle")]
Loading

Recording and Playing a Bag File

Once all the processes above are already up and running, open another terminal outside the container and navigate to the air_systemTwizy directory. Execute the following commands:

./bash_container.sh

Go to the host directory that is mounted inside the container:

cd ~/host

Execute the ros2 command to record the bag:

ros2 bag record -o <bag_name> /velodyne_points

Control the vehicle through the city as you wish and then terminate the process with Ctrl+C. The bag will be stored in the host directory, which can be accessed both from within and outside the container.

NOTE: The command above will only record the /velodyne_points topic. If you want to record all topics, replace /velodyne_points with -a in the ros2 bag record command:

ros2 bag record -o <bag_name> -a

air_systemtwizy's People

Contributors

flying-pqmec avatar gustavomoura628 avatar joserafaelrebelo avatar victormatteus04 avatar

air_systemtwizy's Issues

[BUG]:gazebo_ros_laser_controller is crashing simulation

Description of the bug

I have bug related to the gazebo_ros_laser_controller plugin that simulates the velodyne VLP-16 in my Gazebo Simulation using ROS2 Humble. The URDF file oy my Sensor Lidar3d can be find here.

Everytime I try to access the ros2 topic related to the plugin the simulation starts to "brake".

Steps To Reproduce

To reproduce, you can follow the steps of repository here. Ant then try to access the information of the topic /gazebo_ros_laser_controller/out with any ros2 topic command.

Additional Information

I looked for my velodyne version installed And this is the result output:

air@pmecdesktop01-rtx:~/ros2_ws$ sudo apt-cache show velodyne*
Package: ros-humble-velodyne
Status: install ok installed
Priority: optional
Section: misc
Installed-Size: 63
Maintainer: Josh Whitley [email protected]
Architecture: amd64
Version: 2.4.0-1jammy.20240217.094912
Depends: ros-humble-velodyne-driver, ros-humble-velodyne-laserscan, ros-humble-velodyne-msgs, ros-humble-velodyne-pointcloud, ros-humble-ros-workspace
Description: Basic ROS support for the Velodyne 3D LIDARs.
Description-md5: 22f92506e4132ff5a8e6833b6dceea1f
Homepage: http://www.ros.org/wiki/velodyne

Package: ros-humble-velodyne-driver
Status: install ok installed
Priority: optional
Section: misc
Installed-Size: 390
Maintainer: Josh Whitley [email protected]
Architecture: amd64
Version: 2.4.0-1jammy.20240217.092512
Depends: libc6 (>= 2.34), libconsole-bridge1.0 (>= 1.0.1+dfsg2), libgcc-s1 (>= 3.3.1), libpcap0.8 (>= 1.0.0), libstdc++6 (>= 11), libpcap0.8-dev, ros-humble-diagnostic-msgs, ros-humble-diagnostic-updater, ros-humble-rclcpp, ros-humble-rclcpp-components, ros-humble-tf2-ros, ros-humble-velodyne-msgs, ros-humble-ros-workspace
Description: ROS device driver for Velodyne 3D LIDARs.
Description-md5: ca4af1522d59fc199b54f637f391f588
Homepage: http://www.ros.org/wiki/velodyne_driver

Package: ros-humble-velodyne-laserscan
Status: install ok installed
Priority: optional
Section: misc
Installed-Size: 562
Maintainer: Josh Whitley [email protected]
Architecture: amd64
Version: 2.4.0-1jammy.20240217.082755
Depends: libc6 (>= 2.34), libconsole-bridge1.0 (>= 1.0.1+dfsg2), libgcc-s1 (>= 3.3.1), libstdc++6 (>= 11), ros-humble-rclcpp, ros-humble-rclcpp-components, ros-humble-sensor-msgs, ros-humble-ros-workspace
Description: Extract a single ring of a Velodyne PointCloud2 and publish it as a LaserScan message
Description-md5: b074186f976c914fd8989696a803e624
Homepage: http://ros.org/wiki/velodyne_laserscan

Package: ros-humble-velodyne-msgs
Status: install ok installed
Priority: optional
Section: misc
Installed-Size: 535
Maintainer: Josh Whitley [email protected]
Architecture: amd64
Version: 2.4.0-1jammy.20240217.061835
Depends: libc6 (>= 2.4), libgcc-s1 (>= 3.3.1), libpython3.10 (>= 3.10.0), libstdc++6 (>= 5.2), ros-humble-fastcdr, ros-humble-builtin-interfaces, ros-humble-rosidl-default-runtime, ros-humble-std-msgs, ros-humble-ros-workspace
Description: ROS message definitions for Velodyne 3D LIDARs.
Description-md5: c5e7c2907a077b6187ebd7be777d33cd
Homepage: http://ros.org/wiki/velodyne_msgs

Package: ros-humble-velodyne-pointcloud
Status: install ok installed
Priority: optional
Section: misc
Installed-Size: 1006
Maintainer: Josh Whitley [email protected]
Architecture: amd64
Version: 2.4.0-1jammy.20240217.093714
Depends: libc6 (>= 2.34), libconsole-bridge1.0 (>= 1.0.1+dfsg2), libgcc-s1 (>= 3.3.1), libstdc++6 (>= 11), libyaml-cpp0.7 (>= 0.7.0), libpcl-dev, libyaml-cpp-dev, ros-humble-angles, ros-humble-diagnostic-updater, ros-humble-geometry-msgs, ros-humble-message-filters, ros-humble-rclcpp, ros-humble-rclcpp-components, ros-humble-sensor-msgs, ros-humble-tf2, ros-humble-tf2-ros, ros-humble-velodyne-msgs, ros-humble-ros-workspace
Description: Point cloud conversions for Velodyne 3D LIDARs.
Description-md5: 2658f71086ba1b482063bb45d4cc089b
Homepage: http://ros.org/wiki/velodyne_pointcloud

Package: ros-humble-velodyne-description
Status: install ok installed
Priority: optional
Section: misc
Installed-Size: 1341
Maintainer: Kevin Hallenbeck [email protected]
Architecture: amd64
Version: 2.0.3-1jammy.20240217.045819
Depends: ros-humble-urdf, ros-humble-xacro, ros-humble-ros-workspace
Description: URDF and meshes describing Velodyne laser scanners.
Description-md5: d1f0960c1ca633e46c52f8e35737882c
Homepage: http://wiki.ros.org/velodyne_description

Package: ros-humble-velodyne-driver-dbgsym
Status: install ok installed
Priority: optional
Section: debug
Installed-Size: 1953
Maintainer: Josh Whitley [email protected]
Architecture: amd64
Source: ros-humble-velodyne-driver
Version: 2.4.0-1jammy.20240217.092512
Depends: ros-humble-velodyne-driver (= 2.4.0-1jammy.20240217.092512)
Description: debug symbols for ros-humble-velodyne-driver
Description-md5: f3fc286c05fb26ebcfe2e76e4974cccb
Package-Type: ddeb
Auto-Built-Package: debug-symbols
Build-Ids: a0ad8c4b08ce57f546df38dfee15663a90f742b8 dd9d9308332da6b930083ab7cb2d68e1e8ef2cd0 f6a5f4c5345520af69fc5013f05ecef4b42e1022

Package: ros-humble-velodyne-gazebo-plugins
Status: install ok installed
Priority: optional
Section: misc
Installed-Size: 415
Maintainer: Kevin Hallenbeck [email protected]
Architecture: amd64
Version: 2.0.3-1jammy.20240217.094535
Depends: libc6 (>= 2.34), libgazebo11 (>= 11.10.2+dfsg), libgcc-s1 (>= 3.3.1), libignition-math6-6 (>= 6.10.0+ds3), libprotobuf23 (>= 3.12.4), libsdformat9-9 (>= 9.7.0+ds), libstdc++6 (>= 11), libtbb12 (>= 2021.4.0), ros-humble-gazebo-dev, ros-humble-gazebo-msgs, ros-humble-gazebo-ros, ros-humble-rclcpp, ros-humble-sensor-msgs, ros-humble-ros-workspace
Description: Gazebo plugin to provide simulated data from Velodyne laser scanners.
Description-md5: 668206b49ba5299bae8ef9a65f13118f
Homepage: http://wiki.ros.org/velodyne_gazebo_plugins

Package: ros-humble-velodyne-gazebo-plugins-dbgsym
Status: install ok installed
Priority: optional
Section: debug
Installed-Size: 2108
Maintainer: Kevin Hallenbeck [email protected]
Architecture: amd64
Source: ros-humble-velodyne-gazebo-plugins
Version: 2.0.3-1jammy.20240217.094535
Depends: ros-humble-velodyne-gazebo-plugins (= 2.0.3-1jammy.20240217.094535)
Description: debug symbols for ros-humble-velodyne-gazebo-plugins
Description-md5: 4694e05d787ea8b4e255317c5a9bdf91
Package-Type: ddeb
Auto-Built-Package: debug-symbols
Build-Ids: c405df2f2b299a7d2f130d1527b4ac5d84a3e25b

Package: ros-humble-velodyne-laserscan-dbgsym
Status: install ok installed
Priority: optional
Section: debug
Installed-Size: 2695
Maintainer: Josh Whitley [email protected]
Architecture: amd64
Source: ros-humble-velodyne-laserscan
Version: 2.4.0-1jammy.20240217.082755
Depends: ros-humble-velodyne-laserscan (= 2.4.0-1jammy.20240217.082755)
Description: debug symbols for ros-humble-velodyne-laserscan
Description-md5: 52d8729487fa4f8c6403ad25dffd8c7f
Package-Type: ddeb
Auto-Built-Package: debug-symbols
Build-Ids: 7b93d254fdbea9c8d88dd2d53242a0c9cc42dfa1 cdc51ee2f6df58e22f697f758ad1992954b8c549

Package: ros-humble-velodyne-msgs-dbgsym
Status: install ok installed
Priority: optional
Section: debug
Installed-Size: 357
Maintainer: Josh Whitley [email protected]
Architecture: amd64
Source: ros-humble-velodyne-msgs
Version: 2.4.0-1jammy.20240217.061835
Depends: ros-humble-velodyne-msgs (= 2.4.0-1jammy.20240217.061835)
Description: debug symbols for ros-humble-velodyne-msgs
Description-md5: d3ee03a63479db72f3e7e4d59c5780d9
Package-Type: ddeb
Auto-Built-Package: debug-symbols
Build-Ids: 05a1cc24d4fe2883a7f4b7b1a2b7dd7318eea5ed 060043fb85fdde102c401b3e93a8e6f1d026bebb 0f6c1ab9297b2dd2f459dd76610cc4c2f31659a7 30bfc4aea34affcde556370f4091187ceb568cf1 782650c626ecc906b22ad33eff800204c8c3d857 84a6b2f0dfb15ed68ce61626a446dfcf14ec19aa 8594947b74c502435f0d79b74031d5ac5c3647e2 a1cd14e1f39b491f993e3969131aaf59ea43ed5f a3620a5a4da39c6eca9cbfe55aebad019c0548a1 ad91e8b5b91c6afc71e4a3a4ce7d74cd33b3a535 c1312b002b3bc1a028611be982c2586bc0e9e00c ed6bdfb9ef42d3b3be4d4b0e5295785c048c2561

Package: ros-humble-velodyne-pointcloud-dbgsym
Status: install ok installed
Priority: optional
Section: debug
Installed-Size: 6356
Maintainer: Josh Whitley [email protected]
Architecture: amd64
Source: ros-humble-velodyne-pointcloud
Version: 2.4.0-1jammy.20240217.093714
Depends: ros-humble-velodyne-pointcloud (= 2.4.0-1jammy.20240217.093714)
Description: debug symbols for ros-humble-velodyne-pointcloud
Description-md5: 17e0d906c368ff9eec63ca0a762932dc
Package-Type: ddeb
Auto-Built-Package: debug-symbols
Build-Ids: 1cb672ee30b6f495d13ecd32e546400c92dafe2b c13362e419d20897d661f86d62d9960fdf576992 d8843294a905e6c2ef00ea02be3593fdcae2fe51 fbce3d44ed1791af28bdc71851296e44422b612c

Package: ros-humble-velodyne-simulator
Status: install ok installed
Priority: optional
Section: misc
Installed-Size: 41
Maintainer: Kevin Hallenbeck [email protected]
Architecture: amd64
Version: 2.0.3-1jammy.20240217.095328
Depends: ros-humble-velodyne-description, ros-humble-velodyne-gazebo-plugins, ros-humble-ros-workspace
Description: Metapackage allowing easy installation of Velodyne simulation components.
Description-md5: c152fb8c6a88ad26b0b2c8a16fa9f67e
Homepage: http://wiki.ros.org/velodyne_simulator

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.