Menu
V-REP simulation scene: a Pioneer P3-DX mobile robot with a laser scanner in a room with a table and chairs

Teleoperated SLAM with a Pioneer P3-DX

A ROS project that drives a simulated Pioneer P3‑DX around a V‑REP scene from an Android phone, and feeds a simulated Hokuyo laser scanner into gmapping to build a 2D occupancy‑grid map. The custom part is a Python bridge node that reshapes V‑REP's topics into the odometry, TF and laser scan that ROS SLAM expects.

Overview

The robot lives in a V‑REP scene — a Pioneer P3‑DX differential‑drive base with a laser scanner and a small vision sensor, in a room with furniture. You drive it by keyboard or from the ROS Control Android app; the laser scan and the robot pose come back out of the simulator over ROS, and gmapping turns them into a map you watch build in RViz.

V-REP simulation with the laser scanner active, its rays sweeping the room floor and furniture as a dense red point pattern

The Pioneer's laser scanner sweeping the V‑REP scene.

ROS Architecture

Three sources feed a single bridge node:

  • V‑REP, through its RosInterface plugin, publishes /hokuyo_scan (the laser), /pioneer_pose (ground‑truth pose) and /image (the vision sensor).
  • The ROS Control app publishes /joy_teleop/cmd_vel from its on‑screen joystick, and can also stream the phone's camera as /image_raw/compressed.
  • The bridge node (external_teleop) subscribes to all of the above and republishes them in the form the rest of the stack needs.
rqt_graph of the running system: V-REP's ros interface and the Android controller feeding the external listener node, which outputs tf, odom and the external scan

The running node graph (rqt_graph).

The Bridge Node

V‑REP's topics aren't in the shape gmapping and the Android app expect — the scan has the wrong frame, there is no odometry, and there is no TF tree. subscriber_teleop.py fills those gaps:

InOutWhat the node does
/joy_teleop/cmd_vel/pioneer_cmd_velpasses the joystick Twist through to the V‑REP robot
/hokuyo_scan/extern_scanre‑stamps the LaserScan into the base frame for gmapping
/pioneer_pose/odom, /tf, /tf_staticdifferentiates the pose into odometry and broadcasts the base → hokuyo transform
Focused node graph: the external listener node taking hokuyo_scan, joy_teleop cmd_vel and pioneer_pose and producing tf_static, tf, odom and extern_scan

The bridge node's inputs and outputs.

SLAM

With a laser scan, an odometry source and a valid TF tree in place, gmapping (a particle‑filter SLAM package) estimates the robot's trajectory and accumulates an occupancy‑grid map, published on /map and viewed in RViz. gmapping and its dependencies are built as part of the workspace.

Android Control

The ROS Control app connects straight to the ROS master. Add a robot, set its Master URI to the PC running roscore (its LAN IP, not localhost), and pick Joystick mode.

ROS Control app: the Add/Edit Robot dialog with a robot name and a Master URI pointing at a PC IP address

ROS Control app in Joystick mode, showing speed and heading readouts and a virtual joystick

The phone's camera can also be published into ROS as a compressed image stream, which is why the workspace includes the image_transport and compressed_image_transport packages.

Vision Sensor

The scene also carries a low‑resolution vision sensor on the robot, published on /image — a forward camera view of the room, separate from the laser used for mapping.

The robot's on-board vision sensor feed shown in rqt image view: a pixelated view of a table and floor

The on‑board vision sensor feed.

Running It

Built for ROS Kinetic on Ubuntu, with V‑REP 3.x PRO EDU. Outline:

  1. Build the catkin workspace (catkin build) and source it.
  2. Copy the prebuilt libv_repExtRosInterface.so into the V‑REP folder so the simulator exposes ROS topics.
  3. Start roscore, then launch V‑REP and open scenes/slam_peoneer_p3dx_2.ttt; press play.
  4. Run the bridge node: rosrun external_teleop subscriber_teleop.py.
  5. Connect the Android app (or use keyboard teleop) and drive; run gmapping + RViz to watch the map build.

The repository README has the full step‑by‑step, and the repo ships the V‑REP scene, the RosInterface plugin binaries and the prebuilt packages.

Notes

  • Built on ROS 1 Kinetic and V‑REP, both now superseded by newer ROS distributions and CoppeliaSim — the ideas carry over but the exact commands do not.
  • The odometry in the bridge node is a rough differentiation of the simulator pose; a cleaner version would integrate wheel velocities and add covariance.
  • The committed workspace includes catkin build/ and devel/ artifacts and two large image files misnamed .msg — worth pruning from version control.
Posted In:
Robotics