Skip to content

Instantly share code, notes, and snippets.

@fasilminale
Last active February 20, 2022 23:40
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fasilminale/ee086bb3f229eceaa393517a5e9b4d8e to your computer and use it in GitHub Desktop.
Save fasilminale/ee086bb3f229eceaa393517a5e9b4d8e to your computer and use it in GitHub Desktop.
Robotics lab 1 exercise answers - ETH Zurich

Lab 1 exercise answers

Prepared by Fasil Minale

1. Setup the Husky simulation:

sudo apt-get install ros-k​inetic-husky-simulator
export HUSKY_GAZEBO_DESCRIPTION=$(rospack find husky_gazebo)/urdf/description.gazebo.xacro
roslaunch husky_gazebo husky_empty_world.launch

4. Use ​teleop_twist_keyboard ​to control your robot using the keyboard. Find it online and compile it from source! Use ​git clone ​to clone the repository to the folder ~/git.

cd ~/git
git clone https://github.com/ros-teleop/teleop_twist_keyboard.git
ln -s ~/git/teleop_twist_keyboard/ ~/catkin_ws/src/
cd ~/catkin_ws
catkin build teleop_twist_keyboard
source devel/setup.bash

5. Write a launch file with the following content (refer to the slides in lab lecture 1): husky simulation with a different world: Include ​husky_empty_world.launch ​file and change the ​world_name Argument, e.g. ​worlds/robocup14_spl_field.world ​a world from the directory ​/usr/share/gazebo-7/worlds.

launchfile.launch

<?xml version="1.0"?>
<launch>
   <arg name="world_name" default="worlds/robocup14_spl_field.world"/>

   <!-- <node name="" pkg="" type="" output="" /> -->
   <node name="teleop" pkg="teleop_twist_keyboard" type="teleop_twist_keyboard.py" output="screen" />



   <include file="$(find husky_gazebo)/launch/husky_empty_world.launch">
       <arg name="world_name" value="$(arg world_name)"/>
   </include>
</launch>

copy the launch file wherever you want and launch it.

roslaunch launchfile.launch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment