NIURoverTeam / ExArca

The NIU Ex Arca rover source code
MIT License
0 stars 0 forks source link

Deciding On a Physics Sim Tool #2

Open DrakeProvost opened 3 years ago

DrakeProvost commented 3 years ago

Physics simulators compatible with ROS2

Related tools

DrakeProvost commented 3 years ago

I got Webots to successfully run on shatterdome. I need to find a way to add Webots to the docker image (the instructions below require stdin responses during sudo apt-get install webots (to specify the keyboard's country of origin), which won't work for building an image), but here are the steps I took to make it work:

Webots installation steps I've followed (on shatterdome)

  1. Launch ROS2 docker container.
  2. Follow the Webots installation instructions for Linux using apt.

    You will likely get a sudo: apt-add-repository: command not found at the second step. To resolve, run sudo apt update; sudo apt install software-properties-common and then try the apt-add-repository command again.

  3. Follow the instructions for building the webots_ros2 package.
  4. To resolve a missing library for the webots demo, run sudo apt install libxtst6.
  5. Run this demo using ros2 launch webots_ros2_demos armed_robots.launch.py. It should show two robotic arms moving cans around.
LuckierDodge commented 3 years ago

Looks like there might be a missing library we need to install.

DrakeProvost commented 3 years ago

Fixed, and updated the comment. Webots ran successfully on shatterdome, now I just need to find a way to include it in the Docker image (the technique described above doesn't work since it requires stdin responses while building).

DrakeProvost commented 3 years ago

I got a docker image with both ROS2 and Webots running! 🙌

To run a demo (on shatterdome):

  1. Launch the webots_ros2_foxy docker container
  2. Build the webots_ros2 package in a ROS2 workspace:

    source /opt/ros/$ROS_DISTRO/local_setup.bash
    
    # Retrieve the sources
    cd /path/to/ros2_ws
    git clone --recurse-submodules -b $ROS_DISTRO https://github.com/cyberbotics/webots_ros2.git src/webots_ros2
    
    # Check dependencies
    rosdep update
    rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO
    
    # Building packages
    colcon build
    
    # Source this workspace (careful when also sourcing others)
    source install/local_setup.bash
  3. Run this demo using ros2 launch webots_ros2_demos armed_robots.launch.py. (For some reason this demo is missing the two robotic arms when I run it, but webots launches successfully and responds to interaction so I think webots itself is functional.)
DrakeProvost commented 3 years ago

Webots is already seeming like an attractive choice, but GPU acceleration with shatterdome's nvidia graphics card might make it even better. Here are instructions for that, which I haven't tried yet.