Skip to content

Instantly share code, notes, and snippets.

@jeguzzi
Last active June 12, 2017 21:49
Show Gist options
  • Save jeguzzi/12cae190b36ff0b0982f40ad629c5c9d to your computer and use it in GitHub Desktop.
Save jeguzzi/12cae190b36ff0b0982f40ad629c5c9d to your computer and use it in GitHub Desktop.

Thymio vrep simulation

Installation

  1. Install the dependencies
sudo apt-get install libopencv-dev python-opencv
  1. Download and install vrep 3.3.2 edu from http://www.coppeliarobotics.com/previousversions.html
  2. Build the vrep plugin from the folder
cp -r <VREP>/programming/ros_packages/vrep_common <catkin_ws>/src
cp -r <VREP>/programming/ros_packages/vrep_plugin <catkin_ws>/src
cd <catkin_ws>
export VREP_ROOT=<VREP>
catkin_make
cp devel/lib/libv_repExtRos.so <VREP>
  1. If not already done, compile the thymioid packages
cd src
git clone -b client https://github.com/jeguzzi/ros-aseba.git
git clone -b client https://github.com/jeguzzi/thymioid.git
git clone https://github.com/lrse/ros-keyboard.git
cd ..
catkin_make
  1. Create the following launch file
<?xml version="1.0"?>
<launch>
  <include file="$(find thymio_vrep)/launch/base.launch" />
  <param name="robot_description" command="$(find xacro)/xacro.py '$(find thymioid)/models/thymioid.urdf.xacro'" />
  <node pkg="robot_state_publisher" type="robot_state_publisher" name="rob_st_pub" />
  <node name="teleop" pkg="thymio_navigation" type="remote_to_twist.py" />
  <node name="keyboard" pkg="keyboard" type="keyboard" />
</launch>

Running

  1. Launch roscore
roscore
  1. Launch vrep
<VREP>/vrep.sh
  1. Open the thymio scene located in <catkin_ws>/src/thymioid/usi_lab_4/scene/lab4.skeleton
  2. Launch the simulation by pressing the play button
  3. Launch the launch file
roslaunch <package> <launch_file>
  1. Drive around by using the keyboard arrows (press space to stop) while having the small windows titled ROS keyboard input in focus.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment