diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000000000000000000000000000000000000..82e7142f278ac565e17f3390697edb471affce19 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,6 @@ +FROM osrf/ros:melodic-desktop-full-bionic + +RUN apt-get update && apt-get install -q -y \ + openssh-client + +RUN echo 'source /opt/ros/melodic/setup.bash' >> /root/.bashrc \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000000000000000000000000000000000000..2ea83f82455904851055b7db95043e2690be59a1 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,21 @@ +{ + "name": "panda_simulation-dev", + "dockerFile": "Dockerfile", + "extensions": [ + "ms-vscode.cpptools", + "ms-iot.vscode-ros" + ], + "runArgs": [ + "--cap-add=SYS_PTRACE", + "--security-opt", + "seccomp=unconfined", + "-v", + "${env:HOME}${env:USERPROFILE}/.ssh:/root/.ssh" + ], + "settings": { + "terminal.integrated.shell.linux": "/bin/bash" + }, + "postCreateCommand": "bash /catkin_ws/src/panda_simulation/scripts/docker-setup.sh", + "workspaceMount": "src=/Users/pekel/code/ros/panda_simulation,dst=/catkin_ws/src/panda_simulation,type=bind,consistency=cached", + "workspaceFolder": "/catkin_ws" +} \ No newline at end of file diff --git a/launch/simulation.launch b/launch/simulation.launch index 4aab4321a9a8e5d248de6ab6108aa0672ab536d3..c7f3b0922c911e45eccb0f008a5eb45885131ff8 100644 --- a/launch/simulation.launch +++ b/launch/simulation.launch @@ -40,7 +40,9 @@ <include file="$(find panda_moveit_config)/launch/move_group.launch" > <arg name="load_gripper" value="$(arg load_gripper)" /> </include> - <include file="$(find panda_moveit_config)/launch/moveit_rviz.launch" /> + <group if="$(arg gui)"> + <include file="$(find panda_moveit_config)/launch/moveit_rviz.launch" /> + </group> <node name="joint_state_desired_publisher" pkg="topic_tools" type="relay" args="joint_states joint_states_desired" /> diff --git a/scripts/docker-setup.sh b/scripts/docker-setup.sh new file mode 100644 index 0000000000000000000000000000000000000000..75b6ed1ff487e3b5893847d8a3cb2a717c1d00cf --- /dev/null +++ b/scripts/docker-setup.sh @@ -0,0 +1,33 @@ +#!/bin/bash + +REPOSITORY_DIR=$(pwd) +WORKSPACE_DIR=/catkin_ws +DEPENDENCIES_DIR=$WORKSPACE_DIR/dependencies +APP_DIR=/root/.panda_simulation + +# Install libfranka +mkdir $DEPENDENCIES_DIR && cd $DEPENDENCIES_DIR +git clone --recursive https://github.com/frankaemika/libfranka +cd libfranka +git checkout 0.5.0 +git submodule update +mkdir build && cd build +cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTS=0 .. +cmake --build . -- -j$(nproc) + +# Clone the franka_ros and panda_moveit_config repositories for simulating Panda robot +cd $WORKSPACE_DIR/src +git clone https://github.com/erdalpekel/panda_moveit_config.git +git clone --branch simulation https://github.com/erdalpekel/franka_ros.git + +# Install package dependencies with rosdep +cd $WORKSPACE_DIR +rosdep install --from-paths src --ignore-src -y --skip-keys libfranka --skip-keys moveit_perception + +# Clone the Visual-Studio-Code-ROS repository into the workspace directory /catkin_ws +cd $WORKSPACE_DIR +git clone git@github.com:erdalpekel/Visual-Studio-Code-ROS.git +mv Visual-Studio-Code-ROS .vscode + +# create app directory for config files +mkdir $APP_DIR \ No newline at end of file