Skip to content

PrudhviGudla/AGV-ETH-Zurich-ROS-Exercises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

ETH-Zurich-Exercises

Exercise 1

  1. I first downloaded the zip file given for the exercise 1 from the official website: https://rsl.ethz.ch/education-students/lectures/ros.html

  2. I then extracted the zip file: smb_common into the git folder i made.

  3. I followed this github repository for reference and teleop file. I needed this repo because there were may errors while I ran the launch file of the simulation as I had to install some plugins and the readme files given in the downloaded zip files were not good. Screenshot (614)

  4. Then I created a workspace ' zurich ' with catkin build.

sudo apt-get install python3-catkin-tools
mkdir -p zurich/src
cd ~/zurich
catkin build
  1. Then I downloaded the required plugins/ dependencies
sudo apt install -y ros-<distro>-hector-gazebo-plugins \
                    ros-<distro>-velodyne \
                    ros-<distro>-velodyne-description \
                    ros-<distro>-velodyne-gazebo-plugins \
                    ros-<distro>-pointcloud-to-laserscan \
                    ros-<distro>-twist-mux

where <distro> can be either melodic or noetic.

catkin build
  1. then I used symlink to link packages in my git folder to my workspace and built the package.
ln -s ~/git/smb_common/smb_gazebo/ ~/zurich/src/
catkin build smb_gazebo

similarly for other 2 packages image image

  1. Then I created another package ' exer1 ' and built it
  2. Then I made a folder scripts and made a file : 'teleop_twist_keyboard.py' and copied the code from the repo I mentioned. Then, I made it executable using
chmod +x teleop_twist_keyboard.py

Then, I added these lines in the CMake file of the package

catkin_install_python(PROGRAMS scripts/teleop_twist_keyboard.py
  DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)
  1. I launched the simulation with
roslaunch smb_gazebo smb_gazebo.launch
  1. I ran the teleop node with
rosrun exer1 teleop_twist_keyboard.py

Screenshot (616) Screenshot (619) Screenshot (618)

errors you may face

when u run the teleop file, you will have to make changes in it based on the name of the package in which u created it. image

  1. Now. I changed the world file in launch file code. Screenshot (620) Screenshot (617)

  2. I used rqt graph to generate this Screenshot (615)

Exercise 2

  1. download the zip file and move the package into the same workspace. Make scipts, config, launch folders in the smb_highlevel_controller package
  2. check the topic info /scan, based on that write a node to subscribe to scan topic, its sensor_msgs/LaserScan, so import it accordingly image

image

  1. create a launch file to launch the above subscriber node
  2. then make a config.yaml file with the topic name and queue size in config folder

image

  1. load the parameter server using the launch file

image

  1. access the params using rospy.get_param()

image

  1. check the msg type of laserscan and access the ranges and find min value accordingly image

  2. in rviz, using add option add the following with these params in Global Options, Fixed Frame : odom in PointCloud2, Topic: /rslidar_points, Size: 0.05 in LaserScan, Topic: /scan, Size: 0.05 add TF and RobotModel too

  3. save the rviz configuration as default.rviz in a rviz folder inside the package

  4. add the rviz launching command in the launch file image

  5. Now you can visualize the point clouds and the laser scan in rviz like this: RVIZ Screenshot from 2023-09-04 22-50-35 Gazebo Screenshot from 2023-09-04 22-51-28

  6. Now you can write a subscriber node which subscribes to the rslidar_points and prints the number of points and can launch it through another launch file

image

  1. You can launch a launch file from another launch file and pass arguments to it using the below code.(useful for big projects) image

Some resources:

reading laserscan data https://www.theconstructsim.com/read-laserscan-data/

yaml fromat for rosparam https://roboticsbackend.com/ros-param-yaml-format/

saving a rviz configurationa and launching it through launch file https://www.theconstructsim.com/gazebo-in-5-minutes-010-how-to-launch-rviz-using-a-configuration-file/

showing laser data on rviz https://www.theconstructsim.com/ros-qa-122-how-to-show-laser-data-on-rviz/

launching a launch file from a launch file https://www.theconstructsim.com/ros-5-mins-017-include-launch-file-inside-launch-file/ https://answers.ros.org/question/199152/run-launch-file-with-arg-from-launch-file/ https://wiki.ros.org/roslaunch/XML/include

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published