Skip to content

Instantly share code, notes, and snippets.

@UditSinghParihar
Last active February 23, 2024 13:27
Show Gist options
  • Save UditSinghParihar/75a583f0128ba7a45c4da4099733f4f0 to your computer and use it in GitHub Desktop.
Save UditSinghParihar/75a583f0128ba7a45c4da4099733f4f0 to your computer and use it in GitHub Desktop.
Commands to control p3dx robot
  1. Installation:

    1. Source your ROS version:
      1. source /opt/ros/kinetic/setup.bash
    2. Create temporary catkin workspace or if you want to do in existing workspace, then skip this step:
      1. mkdir -p ~/p3dx_ws/src
      2. cd ~/p3dx_ws/ && catkin_make
      3. source devel/setup.bash
    3. Download p3dx and teleop ros packages:
      1. cd ~/p3dx_ws/src
      2. git clone https://github.com/allenh1/p2os.git
      3. git clone https://github.com/ros-teleop/teleop_twist_joy.git
      4. cd ~/p3dx_ws && catkin_make -j6
  2. Running p3dx:

    1. Plug the p3dx connector and xbox controller to your laptop usb ports and turn on p3dx from the switch on the left.
    2. Check usb device connection and make it executable:
      1. ls /dev/ttyUSB* -l
      2. sudo chmod 777 /dev/ttyUSB0
    3. Launch p3dx controller (Follow RosAria package instead of p2os_launch, as mentioned in section 5):
      1. roslaunch p2os_launch p2os_teleop_joy.launch
    4. Now the p3dx starts making beeping sound so it is ready to control, now press the switch over motors, and then the green light over reset switch would start blinking faster.
    5. Launch teleop node to control p3dx:
      1. roslaunch teleop_twist_joy teleop.launch
  3. Topics:

    1. You can control p3dx now with your xbox controller or publishing messages over /cmd_vel topic.
    2. /cmd_vel: Topic over which you can publish your geometry_msgs/Twist messages.
    3. /pose: Odometry topic published by p3dx to locate it in the environment of message type nav_msgs/Odometry.
  4. Resources:

    1. p2os wiki
    2. teleop wiki
    3. Publishing ros messages over topic
  5. Running p3dx using RosAria instead of p2os:

    1. RosAria
    2. rosrun rosaria RosAria
    3. roslaunch teleop_twist_joy teleop.launch # After remapping cmd_vel to RosAria/cmd_vel in teleop_twist_joy.cpp
  6. Realsense launch:

    1. roslaunch realsense2_camera rs_camera.launch align_depth:=true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment