Setup
Enviroment
The newest version of regarding softwares is recommended.
ROS: Melodic
V-REP: 3.6.2 PRO EDU:Please Select Pro EDU for your own ubuntu version
Platform: Ubuntu 18.04 LTS
The above environment was tested before. If you have any problems, please contact TAs.
We personally tested the raw V-REP: 3.6.2 PRO EDU on ROS-Melodic/Ubuntu 18.04. This setup should also be fine with ROS-Kinetic/Ubuntu 16.04.
Demo
After configuring the environment, run
roscore
And in another terminal, run(under the unzipped VREP_ROOT)
./vrep.sh
In V-REP, load the updated scene file env.ttt. After pressing the start button, you can use
rostopic list
to see the Topics of vrep.
Topics we need:
/vrep/camera_switch
/vrep/cmd_vel
/vrep/image
/vrep/laser_switch
/vrep/scan
/tf
Check the meta-info of a topic:
rostopic info /vrep/cmd_vel
For controling the Pioneer p3dx robot, type the following in terminal
## Translation
rostopic pub -r 10 /vrep/cmd_vel geometry_msgs/Twist '{linear: {x: 1.0, y: 0.0, z: 0.0}, angular: {x: 0.0,y: 0.0,z: 0.0}}'
## Rotation
rostopic pub -r 10 /vrep/cmd_vel geometry_msgs/Twist '{linear: {x: 0.0, y: 0.0, z: 0.0}, angular: {x: 0.0,y: 0.0,z: 1.0}}'
where in "linear" stands for the velocity of the robot (forward as positive), and in "angular" for the rotation (counter clockwise observed from top as positive).
Make sure you can receive lidar scanner output (/vrep/scan), camera output (/vrep/image) and the coordinate transform from base_link to camera_link/laser_link (/tf) on ROS side. You can verify these with ros commands/rviz or your own codes.
Getting more familiar with ROS is part of the project, you could contact me for help while you are encouraged to solve them your own first.