Installing and Setting up P2OS
From Lofaro Lab Wiki
Installing P2OS and Setting Up the ROS Environment
We recommend Gazebo 1.9 with ROS-hydro on Ubuntu 12.04 (for futher information about which combination of ROS/Gazebo verisons to use, see this link. Instructions given on this link. Follow the notes and commands below. See this link for more information.
1) Install P2OS
sudo apt-get install ros-hydro-p2os-driver ros-hydro-p2os-teleop ros-hydro-p2os-launch ros-hydro-p2os-urdf
2) Install P2OS-Controllers-Package
sudo apt-get install ros-groovy-pr2-controllers ros-groovy-joystick-drivers
3) Set up environment but if an environment was previously set up, execute just the last three lines
mkdir -p ~/ros_ws/src cd ~/ros_ws/src catkin_init_workspace cd ~/ros_ws/ catkin_make source devel/setup.bash echo "source ~/ros_ws/devel/setup.bash" >> ~/.bashrc cd src && git clone http://www.hmt-git.com/p2os.git source ../devel/setup.bash cd ~/ros_ws catkin_make
4) Create the p2osTutorials Package
roscreate-pkg p2osTutorial roscpp geometry_msgs nav_msgs source ~/.bashrc
5) Enable p2os Motors
To use the p2os_enableMotor package:
roscd && cd ../src git clone http://www.hmt-git.com/allenh1/vanderbilt-ros-pkg.git source ../devel/setup.bash rosmake p2os_enableMotor rosrun p2os_enableMotor enableMotor
6) Use rostopic
rostopic pub /cmd_motor_state p2os_driver/MotorState 1
<launch> <node name="rostopic" pkg="rostopic" type="rostopic" args="pub -1 /cmd_motor_state p2os_driver/MotorState 1"/> </launch> or with a launch file