From ef96157ff79a75e16eaf6f4c1624c10543d847e4 Mon Sep 17 00:00:00 2001 From: rickstaa Date: Mon, 2 Aug 2021 10:58:09 +0200 Subject: [PATCH] :recycle: Cleans up code base --- README.md | 24 +- .../CMakeLists.txt | 12 +- real_panda_control_examples/README.md | 4 + real_panda_control_examples/cfg/moveit.rviz | 481 ++++++++++++++++++ .../launch/real_panda_moveit_control.launch | 2 +- .../launch/real_panda_traj_control.launch | 4 +- .../package.xml | 7 +- real_panda_moveit_control/README.md | 0 .../singularity/Singularity.ros_noetic-focal | 29 -- scripts/README.md | 6 + .../franka_net_master_connect.setup | 4 - scripts/husky_net_master_connect.setup | 9 + .../master_disconnect.setup | 0 singularity/Singularity.panda_ros_kinetic | 59 +++ singularity/Singularity.panda_ros_melodic | 92 ++++ singularity/Singularity.panda_ros_noetic | 100 ++++ singularity/Singularity.ros_melodic | 51 ++ singularity/resources/.singularity_bashrc | 84 +++ .../bash_aliases/.singularity_bash_aliases | 12 + .../resources/welcome_msgs/.ros-melodic.txt | 26 + .../resources/welcome_msgs/.ros-noetic.txt | 26 + 21 files changed, 982 insertions(+), 50 deletions(-) rename {real_panda_moveit_control => real_panda_control_examples}/CMakeLists.txt (94%) create mode 100644 real_panda_control_examples/README.md create mode 100644 real_panda_control_examples/cfg/moveit.rviz rename {real_panda_moveit_control => real_panda_control_examples}/launch/real_panda_moveit_control.launch (94%) rename real_panda_moveit_control/launch/real_panda_traj_gui_control.launch => real_panda_control_examples/launch/real_panda_traj_control.launch (86%) rename {real_panda_moveit_control => real_panda_control_examples}/package.xml (92%) delete mode 100644 real_panda_moveit_control/README.md delete mode 100644 real_panda_moveit_control/containers/singularity/Singularity.ros_noetic-focal create mode 100644 scripts/README.md rename {real_panda_moveit_control/scripts => scripts}/franka_net_master_connect.setup (76%) create mode 100644 scripts/husky_net_master_connect.setup rename real_panda_moveit_control/scripts/franka_net_master_disconnect.setup => scripts/master_disconnect.setup (100%) create mode 100644 singularity/Singularity.panda_ros_kinetic create mode 100644 singularity/Singularity.panda_ros_melodic create mode 100644 singularity/Singularity.panda_ros_noetic create mode 100644 singularity/Singularity.ros_melodic create mode 100644 singularity/resources/.singularity_bashrc create mode 100644 singularity/resources/bash_aliases/.singularity_bash_aliases create mode 100644 singularity/resources/welcome_msgs/.ros-melodic.txt create mode 100644 singularity/resources/welcome_msgs/.ros-noetic.txt diff --git a/README.md b/README.md index b5d3ff9..422f539 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ # Real panda control examples -This repository contains several examples for controlling the real panda robot. It was created as a supliment to the official [panda documentation](https://frankaemika.github.io/docs/installation_linux.html). Further it serves as a storage place for several problems I encountered while working with the panda robot (see the [discussions section](https://github.com/rickstaa/real-panda-control-examples/discussions)). +This repository contains several examples for controlling the real panda robot. It was created as a supplement to the official [panda documentation](https://frankaemika.github.io/docs/installation_linux.html). Further it serves as a storage place for several problems I encountered while working with the panda robot (see the [discussions section](https://github.com/rickstaa/real-panda-control-examples/discussions)). ## Clone instructions -To clone the respository use the following command: +To clone the repository use the following command: ```bash mkdir real_catkin_ws cd real_catkin_ws -git clone --recurse-submodules https://github.com/rickstaa/real_panda_moveit_control.git src +git clone --recurse-submodules https://github.com/rickstaa/real_panda_control_examples.git src ``` ## Build instructions @@ -38,8 +38,22 @@ To test out Moveit control, after you build and sourced the catkin workspace, yo roslaunch panda_moveit_config panda_control_moveit_rviz.launch load_gripper:=true robot_ip:=172.16.0.2 ``` -Additionally the `real_panda_moveit_control` contains a slightly modified version of this example: +Additionally the `real_panda_control_examples` contains a slightly modified version of this example: ```bash -roslaunch real_panda_moveit_control real_panda_moveit_control.launch +roslaunch real_panda_control_examples real_panda_moveit_control.launch +``` + +## Trajectory control example launch instructions + +To test out Trajectory control, after you build and sourced the catkin workspace, you can launch the example included in the `panda_moveit_config` using the following command: + +```bash +roslaunch panda_moveit_config panda_control_moveit_rviz.launch load_gripper:=true robot_ip:=172.16.0.2 +``` + +Additionally the `real_panda_control_examples` contains a slightly modified version of this example: + +```bash +roslaunch real_panda_control_examples real_panda_traj_control.launch ``` diff --git a/real_panda_moveit_control/CMakeLists.txt b/real_panda_control_examples/CMakeLists.txt similarity index 94% rename from real_panda_moveit_control/CMakeLists.txt rename to real_panda_control_examples/CMakeLists.txt index 98ba66e..5be1758 100644 --- a/real_panda_moveit_control/CMakeLists.txt +++ b/real_panda_control_examples/CMakeLists.txt @@ -1,5 +1,5 @@ cmake_minimum_required(VERSION 3.0.2) -project(real_panda_moveit_control) +project(real_panda_control_examples) ## Compile as C++11, supported in ROS Kinetic and newer # add_compile_options(-std=c++11) @@ -104,8 +104,8 @@ find_package(catkin REQUIRED COMPONENTS ## DEPENDS: system dependencies of this project that dependent projects also need catkin_package( # INCLUDE_DIRS include -# LIBRARIES real_panda_moveit_control -# CATKIN_DEPENDS roscpp rospy std_msgs +# LIBRARIES real_panda_control_examples + CATKIN_DEPENDS roscpp rospy std_msgs ros_controllers rqt_joint_trajectory_controller # DEPENDS system_lib ) @@ -122,7 +122,7 @@ include_directories( ## Declare a C++ library # add_library(${PROJECT_NAME} -# src/${PROJECT_NAME}/real_panda_moveit_control.cpp +# src/${PROJECT_NAME}/real_panda_control_examples.cpp # ) ## Add cmake target dependencies of the library @@ -133,7 +133,7 @@ include_directories( ## Declare a C++ executable ## With catkin_make all packages are built within a single CMake context ## The recommended prefix ensures that target names across packages don't collide -# add_executable(${PROJECT_NAME}_node src/real_panda_moveit_control_node.cpp) +# add_executable(${PROJECT_NAME}_node src/real_panda_control_examples_node.cpp) ## Rename C++ executable without prefix ## The above recommended prefix causes long target names, the following renames the @@ -197,7 +197,7 @@ include_directories( ############# ## Add gtest based cpp test target and link libraries -# catkin_add_gtest(${PROJECT_NAME}-test test/test_real_panda_moveit_control.cpp) +# catkin_add_gtest(${PROJECT_NAME}-test test/test_real_panda_control_examples.cpp) # if(TARGET ${PROJECT_NAME}-test) # target_link_libraries(${PROJECT_NAME}-test ${PROJECT_NAME}) # endif() diff --git a/real_panda_control_examples/README.md b/real_panda_control_examples/README.md new file mode 100644 index 0000000..3967c89 --- /dev/null +++ b/real_panda_control_examples/README.md @@ -0,0 +1,4 @@ +# Real panda MoveIt control + +This folder contains several launch scripts that can be used to control the real panda_robot using +MoveIt. diff --git a/real_panda_control_examples/cfg/moveit.rviz b/real_panda_control_examples/cfg/moveit.rviz new file mode 100644 index 0000000..b285298 --- /dev/null +++ b/real_panda_control_examples/cfg/moveit.rviz @@ -0,0 +1,481 @@ +Panels: + - Class: rviz/Displays + Help Height: 84 + Name: Displays + Property Tree Widget: + Expanded: + - /MarkerArray1 + - /PlanningScene1/Scene Robot1 + Splitter Ratio: 0.7425600290298462 + Tree Height: 94 + - Class: rviz/Help + Name: Help + - Class: rviz/Views + Expanded: + - /Current View1 + Name: Views + Splitter Ratio: 0.5 + - Class: rviz_visual_tools/RvizVisualToolsGui + Name: RvizVisualToolsGui +Preferences: + PromptSaveOnExit: true +Toolbars: + toolButtonStyle: 2 +Visualization Manager: + Class: "" + Displays: + - Alpha: 0.5 + Cell Size: 1 + Class: rviz/Grid + Color: 160; 160; 164 + Enabled: true + Line Style: + Line Width: 0.029999999329447746 + Value: Lines + Name: Grid + Normal Cell Count: 0 + Offset: + X: 0 + Y: 0 + Z: 0 + Plane: XY + Plane Cell Count: 10 + Reference Frame: + Value: true + - Class: rviz/MarkerArray + Enabled: true + Marker Topic: /rviz_visual_tools + Name: MarkerArray + Namespaces: + {} + Queue Size: 100 + Value: true + - Class: moveit_rviz_plugin/Trajectory + Color Enabled: false + Enabled: true + Interrupt Display: false + Links: + All Links Enabled: true + Expand Joint Details: false + Expand Link Details: false + Expand Tree: false + Link Tree Style: Links in Alphabetic Order + panda_hand: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_leftfinger: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link0: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link1: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link2: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link3: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link4: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link5: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link6: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link7: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link8: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_rightfinger: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + Loop Animation: false + Name: Trajectory + Robot Alpha: 0.5 + Robot Color: 150; 50; 150 + Robot Description: robot_description + Show Robot Collision: false + Show Robot Visual: true + Show Trail: false + State Display Time: 0.05 s + Trail Step Size: 1 + Trajectory Topic: /move_group/display_planned_path + Value: true + - Class: moveit_rviz_plugin/PlanningScene + Enabled: true + Move Group Namespace: "" + Name: PlanningScene + Planning Scene Topic: /move_group/monitored_planning_scene + Robot Description: robot_description + Scene Geometry: + Scene Alpha: 0.8999999761581421 + Scene Color: 50; 230; 50 + Scene Display Time: 0.20000000298023224 + Show Scene Geometry: true + Voxel Coloring: Z-Axis + Voxel Rendering: Occupied Voxels + Scene Robot: + Attached Body Color: 150; 50; 150 + Links: + All Links Enabled: true + Expand Joint Details: false + Expand Link Details: false + Expand Tree: false + Link Tree Style: Links in Alphabetic Order + panda_hand: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_leftfinger: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link0: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link1: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link2: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link3: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link4: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link5: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link6: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link7: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link8: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_rightfinger: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + Robot Alpha: 1 + Show Robot Collision: false + Show Robot Visual: true + Value: true + - Acceleration_Scaling_Factor: 0.1 + Class: moveit_rviz_plugin/MotionPlanning + Enabled: true + Move Group Namespace: "" + MoveIt_Allow_Approximate_IK: false + MoveIt_Allow_External_Program: false + MoveIt_Allow_Replanning: false + MoveIt_Allow_Sensor_Positioning: false + MoveIt_Planning_Attempts: 10 + MoveIt_Planning_Time: 5 + MoveIt_Use_Cartesian_Path: false + MoveIt_Use_Constraint_Aware_IK: false + MoveIt_Warehouse_Host: 127.0.0.1 + MoveIt_Warehouse_Port: 33829 + MoveIt_Workspace: + Center: + X: 0 + Y: 0 + Z: 0 + Size: + X: 2 + Y: 2 + Z: 2 + Name: MotionPlanning + Planned Path: + Color Enabled: false + Interrupt Display: false + Links: + All Links Enabled: true + Expand Joint Details: false + Expand Link Details: false + Expand Tree: false + Link Tree Style: Links in Alphabetic Order + panda_hand: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_leftfinger: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link0: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link1: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link2: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link3: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link4: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link5: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link6: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link7: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link8: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_rightfinger: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + Loop Animation: false + Robot Alpha: 0.5 + Robot Color: 150; 50; 150 + Show Robot Collision: false + Show Robot Visual: true + Show Trail: false + State Display Time: 0.05 s + Trail Step Size: 1 + Trajectory Topic: /move_group/display_planned_path + Planning Metrics: + Payload: 1 + Show Joint Torques: false + Show Manipulability: false + Show Manipulability Index: false + Show Weight Limit: false + TextHeight: 0.07999999821186066 + Planning Request: + Colliding Link Color: 255; 0; 0 + Goal State Alpha: 1 + Goal State Color: 250; 128; 0 + Interactive Marker Size: 0 + Joint Violation Color: 255; 0; 255 + Planning Group: panda_arm + Query Goal State: true + Query Start State: false + Show Workspace: false + Start State Alpha: 1 + Start State Color: 0; 255; 0 + Planning Scene Topic: move_group/monitored_planning_scene + Robot Description: robot_description + Scene Geometry: + Scene Alpha: 0.8999999761581421 + Scene Color: 50; 230; 50 + Scene Display Time: 0.009999999776482582 + Show Scene Geometry: true + Voxel Coloring: Z-Axis + Voxel Rendering: Occupied Voxels + Scene Robot: + Attached Body Color: 150; 50; 150 + Links: + All Links Enabled: true + Expand Joint Details: false + Expand Link Details: false + Expand Tree: false + Link Tree Style: Links in Alphabetic Order + panda_hand: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_leftfinger: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link0: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link1: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link2: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link3: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link4: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link5: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link6: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link7: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_link8: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + panda_rightfinger: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + Robot Alpha: 1 + Show Robot Collision: false + Show Robot Visual: true + Value: true + Velocity_Scaling_Factor: 0.1 + Enabled: true + Global Options: + Background Color: 48; 48; 48 + Default Light: true + Fixed Frame: panda_link0 + Frame Rate: 30 + Name: root + Tools: + - Class: rviz/Interact + Hide Inactive Objects: true + - Class: rviz/MoveCamera + - Class: rviz/Select + - Class: rviz_visual_tools/KeyTool + Value: true + Views: + Current: + Class: rviz/XYOrbit + Distance: 2.827594041824341 + Enable Stereo Rendering: + Stereo Eye Separation: 0.05999999865889549 + Stereo Focal Distance: 1 + Swap Stereo Eyes: false + Value: false + Field of View: 0.7853981852531433 + Focal Point: + X: 0.11356700211763382 + Y: 0.10592000186443329 + Z: 2.2351800055275817e-07 + Focal Shape Fixed Size: true + Focal Shape Size: 0.05000000074505806 + Invert Z Axis: false + Name: Current View + Near Clip Distance: 0.009999999776482582 + Pitch: 0.47020357847213745 + Target Frame: panda_link0 + Yaw: 6.059959888458252 + Saved: ~ +Window Geometry: + Displays: + collapsed: false + Height: 995 + Help: + collapsed: false + Hide Left Dock: false + Hide Right Dock: false + MotionPlanning: + collapsed: false + MotionPlanning - Trajectory Slider: + collapsed: false + QMainWindow State: 000000ff00000000fd0000000100000000000001f300000389fc0200000010fb000000100044006900730070006c006100790073010000003d000000ef000000c900fffffffb0000000800480065006c00700000000342000000bb0000006e00fffffffb0000000a00560069006500770073000000026d000000b5000000a400fffffffb0000000c00430061006d00650072006100000002ff000001610000000000000000fb0000001e004d006f00740069006f006e00200050006c0061006e006e0069006e00670100000374000001890000000000000000fb0000002e004d006f00740069006f006e0050006c0061006e006e0069006e00670020002d00200053006c0069006400650072010000026f000000480000000000000000fb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e00670100000132000002410000017d00fffffffb00000024005200760069007a00560069007300750061006c0054006f006f006c007300470075006901000003790000004d0000004100fffffffb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e0067010000034f000001fb0000000000000000fb000000120020002d00200053006c006900640065007201000002df000000480000000000000000fb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e0067010000032d000001fb0000000000000000fb00000044004d006f00740069006f006e0050006c0061006e006e0069006e00670020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000001600000016fb000000280020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000000000000000fb0000003c005400720061006a006500630074006f007200790020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000001600000016fb000000280020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000000000000000fb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e006701000001b2000002140000000000000000000005870000038900000001000000020000000100000002fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + RvizVisualToolsGui: + collapsed: false + Trajectory - Trajectory Slider: + collapsed: false + Views: + collapsed: false + Width: 1920 + X: 0 + Y: 0 diff --git a/real_panda_moveit_control/launch/real_panda_moveit_control.launch b/real_panda_control_examples/launch/real_panda_moveit_control.launch similarity index 94% rename from real_panda_moveit_control/launch/real_panda_moveit_control.launch rename to real_panda_control_examples/launch/real_panda_moveit_control.launch index 29b33e6..c71a60d 100644 --- a/real_panda_moveit_control/launch/real_panda_moveit_control.launch +++ b/real_panda_control_examples/launch/real_panda_moveit_control.launch @@ -31,6 +31,6 @@ - + diff --git a/real_panda_moveit_control/launch/real_panda_traj_gui_control.launch b/real_panda_control_examples/launch/real_panda_traj_control.launch similarity index 86% rename from real_panda_moveit_control/launch/real_panda_traj_gui_control.launch rename to real_panda_control_examples/launch/real_panda_traj_control.launch index 60ee7e3..5c30457 100644 --- a/real_panda_moveit_control/launch/real_panda_traj_gui_control.launch +++ b/real_panda_control_examples/launch/real_panda_traj_control.launch @@ -18,7 +18,7 @@ - + @@ -32,6 +32,6 @@ - + diff --git a/real_panda_moveit_control/package.xml b/real_panda_control_examples/package.xml similarity index 92% rename from real_panda_moveit_control/package.xml rename to real_panda_control_examples/package.xml index 605ded0..addd02f 100644 --- a/real_panda_moveit_control/package.xml +++ b/real_panda_control_examples/package.xml @@ -1,8 +1,8 @@ - real_panda_moveit_control + real_panda_control_examples 0.0.0 - The real_panda_moveit_control package + The real_panda_control_examples package @@ -19,7 +19,7 @@ - + @@ -59,6 +59,7 @@ roscpp rospy std_msgs + ros_controllers rqt_joint_trajectory_controller diff --git a/real_panda_moveit_control/README.md b/real_panda_moveit_control/README.md deleted file mode 100644 index e69de29..0000000 diff --git a/real_panda_moveit_control/containers/singularity/Singularity.ros_noetic-focal b/real_panda_moveit_control/containers/singularity/Singularity.ros_noetic-focal deleted file mode 100644 index d188b69..0000000 --- a/real_panda_moveit_control/containers/singularity/Singularity.ros_noetic-focal +++ /dev/null @@ -1,29 +0,0 @@ -# Ubuntu 20.04 - Ros noetic container (NO NVIDIA cards) -Bootstrap: docker -From: osrf/ros:noetic-desktop-full - -%help - A container used for running ros-noetic. -%labels - Maintainer: Rick Staa - Github: https://github.com/rickstaa - Version: v0.0.5 - Type: Private -%environment - # Set language options - LANG=C.UTF-8 LC_ALL=C.UTF-8 - - # Set ROS distro var - export ROS_DISTRO=melodic -%post - # Install system package dependencies - apt update --fix-missing - - # Install additional system packages - apt install -q -y \ - vim \ - git \ - bash-completion \ - htop \ - wget \ - lsb-release \ \ No newline at end of file diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 0000000..77841e9 --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,6 @@ +# Scripts + +You can source the `franka_net_master_connect.setup` scripts in this folder to setup the +needed environment variables to send control commands to the workstation that controls +the Panda Emika Franka robot. You can source `franka_net_master_disconnect.setup` script +to reset the settings again to enable local control. diff --git a/real_panda_moveit_control/scripts/franka_net_master_connect.setup b/scripts/franka_net_master_connect.setup similarity index 76% rename from real_panda_moveit_control/scripts/franka_net_master_connect.setup rename to scripts/franka_net_master_connect.setup index d3a5176..cef47b2 100644 --- a/real_panda_moveit_control/scripts/franka_net_master_connect.setup +++ b/scripts/franka_net_master_connect.setup @@ -1,9 +1,5 @@ #!/bin/bash # Small script used to connect to the roscore running on the workstation -# Input the ip where the ros core is running -master_ip=${1:-172.16.0.1} -echo $master_ip -# Create required environmental variables export ROS_MASTER_URI=http://172.16.0.1:11311 # export ROS_HOSTNAME=$(hostname) # Use if the hostname is resolvable on the network machine_ip=(`hostname -I`) diff --git a/scripts/husky_net_master_connect.setup b/scripts/husky_net_master_connect.setup new file mode 100644 index 0000000..8685e93 --- /dev/null +++ b/scripts/husky_net_master_connect.setup @@ -0,0 +1,9 @@ +#!/bin/bash +# Small script used to connect to the roscore running on the workstation +export ROS_MASTER_URI=http://192.168.131.1:11311 +# export ROS_HOSTNAME=$(hostname) # Use if the hostname is resolvable on the network +machine_ip=(`hostname -I`) +export ROS_IP=${machine_ip[1]} # Use if the hostname can not be resolved on the network +echo "ROS_MASTER_URI=$ROS_MASTER_URI" +echo "ROS_HOSTNAME=$ROS_HOSTNAME" +echo "ROS_IP=$ROS_IP" \ No newline at end of file diff --git a/real_panda_moveit_control/scripts/franka_net_master_disconnect.setup b/scripts/master_disconnect.setup similarity index 100% rename from real_panda_moveit_control/scripts/franka_net_master_disconnect.setup rename to scripts/master_disconnect.setup diff --git a/singularity/Singularity.panda_ros_kinetic b/singularity/Singularity.panda_ros_kinetic new file mode 100644 index 0000000..b7f7cf0 --- /dev/null +++ b/singularity/Singularity.panda_ros_kinetic @@ -0,0 +1,59 @@ +# Ubuntu 16.04 - Ros noetic franka ros container +Bootstrap: docker +From: osrf/ros:kinetic-desktop-full + +%help + A container used for controlling the panda_franka robot using ros-noetic. +%labels + Maintainer: Rick Staa + Github: https://github.com/rickstaa/COR-robotics-lab-reference + Version: v0.0.0 + Type: Private +%environment + # Set language options + export LANG=C.UTF-8 LC_ALL=C.UTF-8 + + # Set ROS vars + export ROS_DISTRO=noetic + export ROBOT_IP="172.16.0.2" + export ROS_MASTER_URI="http://${ROBOT_IP}:11311" + machine_ip=(`hostname -I | grep ${ROBOT_IP%.*}`) + export ROS_IP=${machine_ip[0]} +%post + # Install system package dependencies + apt update --fix-missing + apt install -q -y \ + vim \ + git \ + bash-completion \ + wget \ + lsb-release \ + iputils-ping + apt upgrade -y + + # Install ros build tools + apt install -q -y python-catkin-tools \ + python-rosdep \ + python-rosinstall \ + python-rosinstall-generator \ + python-wstool \ + build-essential + # NOTE: Needed because of a catkin-tools bug https://github.com/catkin/catkin_tools/issues/594) + apt install -q -y python-osrf-pycommon + + # Install extra ROS packages + apt install -y ros-kinetic-ros-controllers + + # Add container resources to the container + bash -c "cd / \ + && git clone https://github.com/rickstaa/COR-robot-lab-reference.git \ + && cp ./COR-robot-lab-reference/containers/singularity/resources/.singularity_bashrc /.singularity_bashrc \ + && cp ./COR-robot-lab-reference/containers/singularity/resources/welcome_msgs/.ros-noetic.txt /.welcome_msg \ + && cp ./COR-robot-lab-reference/containers/singularity/resources/bash_aliases/.singularity_bash_aliases /.singularity_bash_aliases \ + && rm -rf /COR-robot-lab-reference" +%runscript + # Execute the .singularity_bashrc file + OCI_CMD='/bin/bash' + OCI_ARGS='-rcfile /.singularity_bashrc' + SINGULARITY_OCI_RUN="${OCI_CMD} ${OCI_ARGS}" + exec $SINGULARITY_OCI_RUN diff --git a/singularity/Singularity.panda_ros_melodic b/singularity/Singularity.panda_ros_melodic new file mode 100644 index 0000000..241c552 --- /dev/null +++ b/singularity/Singularity.panda_ros_melodic @@ -0,0 +1,92 @@ +# Ubuntu 18.04 - Ros melodic franka ros container +Bootstrap: docker +From: osrf/ros:melodic-desktop-full + +%help + A container used for controlling the panda_franka robot using ros-melodic. +%labels + Maintainer: Rick Staa + Github: https://github.com/rickstaa/COR-robotics-lab-reference + Version: v0.0.0 + Type: Private +%environment + # Set language options + export LANG=C.UTF-8 LC_ALL=C.UTF-8 + + # Set ROS vars + export ROS_DISTRO=melodic + export ROBOT_IP="172.16.0.2" + export ROS_MASTER_URI="http://${ROBOT_IP}:11311" + machine_ip=(`hostname -I | grep ${ROBOT_IP%.*}`) + export ROS_IP=${machine_ip[0]} +%post + # Install system package dependencies + apt update --fix-missing + apt install -q -y \ + vim \ + git \ + bash-completion \ + wget \ + lsb-release \ + iputils-ping + apt upgrade -y + + # Install ros build tools + apt install -q -y python-catkin-tools \ + python-rosdep \ + python-rosinstall \ + python-rosinstall-generator \ + python-wstool \ + build-essential + + # Install libfranka from source + # NOTE: Uncomment if you want to install from source + apt update + apt install -q -y \ + cmake \ + libpoco-dev \ + libeigen3-dev + bash -c "cd / \ + && apt remove -y \"*libfranka*\" \ + && git clone --recursive https://github.com/frankaemika/libfranka.git \ + && cd libfranka \ + && mkdir build \ + && cd build \ + && cmake -DCMAKE_BUILD_TYPE=Release .. \ + && cmake --build ." + + # Install libfranka binary packages + # NOTE: Uncomment the code below when you want to install the binary packages + # apt install -y ros-melodic-libfranka + + # Create the catkin workspace + mkdir -p /panda_ws/src; cd /panda_ws/src + + # Install ros_franka from the repository + # NOTE: Uncomment if you want to install franka_ros from the repository + git clone --recursive https://github.com/frankaemika/franka_ros franka_ros + cd franka_ros; git checkout melodic-devel; cd ../.. + rosdep install --from-paths src --ignore-src --rosdistro melodic -y --skip-keys libfranka + # . /opt/ros/melodic/setup.sh; catkin_make -DCMAKE_BUILD_TYPE=Release -DFranka_DIR:PATH=/libfranka/build + . /opt/ros/melodic/setup.sh; catkin build -DCMAKE_BUILD_TYPE=Release -DFranka_DIR:PATH=/libfranka/build + + # Install ros_franka binary packages + # NOTE: Uncomment the code below when you want to install the binary packages + # apt install -y ros-melodic-franka-ros + + # Install extra ROS packages + apt install -y ros-melodic-ros-controllers + + # Add container resources to the container + bash -c "cd / \ + && git clone https://github.com/rickstaa/COR-robot-lab-reference.git \ + && cp ./COR-robot-lab-reference/containers/singularity/resources/.singularity_bashrc /.singularity_bashrc \ + && cp ./COR-robot-lab-reference/containers/singularity/resources/welcome_msgs/.ros-melodic.txt /.welcome_msg \ + && cp ./COR-robot-lab-reference/containers/singularity/resources/bash_aliases/.singularity_bash_aliases /.singularity_bash_aliases \ + && rm -rf /COR-robot-lab-reference" +%runscript + # Execute the .singularity_bashrc file + OCI_CMD='/bin/bash' + OCI_ARGS='-rcfile /.singularity_bashrc' + SINGULARITY_OCI_RUN="${OCI_CMD} ${OCI_ARGS}" + exec $SINGULARITY_OCI_RUN diff --git a/singularity/Singularity.panda_ros_noetic b/singularity/Singularity.panda_ros_noetic new file mode 100644 index 0000000..4e14e7b --- /dev/null +++ b/singularity/Singularity.panda_ros_noetic @@ -0,0 +1,100 @@ +# Ubuntu 20.04 - Ros noetic franka ros container +Bootstrap: docker +From: osrf/ros:noetic-desktop-full + +%help + A container used for controlling the panda_franka robot using ros-noetic. +%labels + Maintainer: Rick Staa + Github: https://github.com/rickstaa/COR-robotics-lab-reference + Version: v0.0.0 + Type: Private +%environment + # Set language options + export LANG=C.UTF-8 LC_ALL=C.UTF-8 + + # Set ROS vars + export ROS_DISTRO=noetic + export ROBOT_IP="172.16.0.2" + export ROS_MASTER_URI="http://${ROBOT_IP}:11311" + machine_ip=(`hostname -I | grep ${ROBOT_IP%.*}`) + export ROS_IP=${machine_ip[0]} +%post + # Install system package dependencies + apt update --fix-missing + apt install -q -y \ + vim \ + git \ + bash-completion \ + wget \ + lsb-release \ + iputils-ping + apt upgrade -y + + # Install ros build tools + apt install -q -y python3-catkin-tools \ + python3-rosdep \ + python3-rosinstall \ + python3-rosinstall-generator \ + python3-wstool \ + build-essential + # NOTE: Needed because of a catkin-tools bug https://github.com/catkin/catkin_tools/issues/594) + apt install -q -y python3-osrf-pycommon + + # Install libfranka from source + # NOTE: Uncomment if you want to install from source + apt update + apt install -q -y \ + cmake \ + libpoco-dev \ + libeigen3-dev + bash -c "cd / \ + && apt remove -y \"*libfranka*\" \ + && git clone --recursive https://github.com/frankaemika/libfranka.git \ + && cd libfranka \ + && mkdir build \ + && cd build \ + && cmake -DCMAKE_BUILD_TYPE=Release .. \ + && cmake --build ." + + # Install libfranka binary packages + # NOTE: Uncomment the code below when you want to install the binary packages + apt install -y ros-noetic-libfranka + + # Create the catkin workspace + mkdir -p /panda_ws/src; cd /panda_ws/src + + # Install the noetic panda_moveit_config branch + # NOTE: Needed since panda_moveit_config is not yet released for noetic (see + # https://github.com/ros-planning/panda_moveit_config/pull/74) + git clone https://github.com/tylerjw/panda_moveit_config.git + cd panda_moveit_config; git checkout p/update_latest; cd - + + # Install ros_franka from the repository + # NOTE: Uncomment if you want to install franka_ros from the repository + git clone --recursive https://github.com/frankaemika/franka_ros franka_ros + cd franka_ros; git checkout noetic-devel; cd ../.. + rosdep install --from-paths src --ignore-src --rosdistro noetic -y --skip-keys libfranka + # . /opt/ros/noetic/setup.sh; catkin_make -DCMAKE_BUILD_TYPE=Release -DFranka_DIR:PATH=/libfranka/build + . /opt/ros/noetic/setup.sh; catkin build -DCMAKE_BUILD_TYPE=Release -DFranka_DIR:PATH=/libfranka/build + + # Install ros_franka binary packages + # NOTE: Uncomment the code below when you want to install the binary packages + # apt install -y ros-noetic-franka-ros + + # Install extra ROS packages + apt install -y ros-noetic-ros-controllers + + # Add container resources to the container + bash -c "cd / \ + && git clone https://github.com/rickstaa/COR-robot-lab-reference.git \ + && cp ./COR-robot-lab-reference/containers/singularity/resources/.singularity_bashrc /.singularity_bashrc \ + && cp ./COR-robot-lab-reference/containers/singularity/resources/welcome_msgs/.ros-noetic.txt /.welcome_msg \ + && cp ./COR-robot-lab-reference/containers/singularity/resources/bash_aliases/.singularity_bash_aliases /.singularity_bash_aliases \ + && rm -rf /COR-robot-lab-reference" +%runscript + # Execute the .singularity_bashrc file + OCI_CMD='/bin/bash' + OCI_ARGS='-rcfile /.singularity_bashrc' + SINGULARITY_OCI_RUN="${OCI_CMD} ${OCI_ARGS}" + exec $SINGULARITY_OCI_RUN diff --git a/singularity/Singularity.ros_melodic b/singularity/Singularity.ros_melodic new file mode 100644 index 0000000..67dc447 --- /dev/null +++ b/singularity/Singularity.ros_melodic @@ -0,0 +1,51 @@ +# Ubuntu 18.04 - Ros melodic franka ros container +Bootstrap: docker +From: osrf/ros:melodic-desktop-full + +%help + A container with ROS melodic installed. Usefull when you want to a robot that uses + ROS melodic while your own system has a different ROS version installed. +%labels + Maintainer: Rick Staa + Github: https://github.com/rickstaa/COR-robotics-lab-reference + Version: v0.0.0 + Type: Private +%environment + # Set language options + export LANG=C.UTF-8 LC_ALL=C.UTF-8 + + # Set ROS vars + export ROS_DISTRO=melodic +%post + # Install extra system package dependencies + apt update --fix-missing + apt install -q -y \ + vim \ + git \ + bash-completion \ + wget \ + lsb-release \ + iputils-ping + apt upgrade -y + + # Install ros build tools + apt install -q -y python-catkin-tools \ + python-rosdep \ + python-rosinstall \ + python-rosinstall-generator \ + python-wstool \ + build-essential + + # Add container resources to the container + bash -c "cd / \ + && git clone https://github.com/rickstaa/COR-robot-lab-reference.git \ + && cp ./COR-robot-lab-reference/containers/singularity/resources/.singularity_bashrc /.singularity_bashrc \ + && cp ./COR-robot-lab-reference/containers/singularity/resources/welcome_msgs/.ros-melodic.txt /.welcome_msg \ + && cp ./COR-robot-lab-reference/containers/singularity/resources/bash_aliases/.singularity_bash_aliases /.singularity_bash_aliases \ + && rm -rf /COR-robot-lab-reference" +%runscript + # Execute the .singularity_bashrc file + OCI_CMD='/bin/bash' + OCI_ARGS='-rcfile /.singularity_bashrc' + SINGULARITY_OCI_RUN="${OCI_CMD} ${OCI_ARGS}" + exec $SINGULARITY_OCI_RUN diff --git a/singularity/resources/.singularity_bashrc b/singularity/resources/.singularity_bashrc new file mode 100644 index 0000000..065813f --- /dev/null +++ b/singularity/resources/.singularity_bashrc @@ -0,0 +1,84 @@ +#### Singularity container .bashrc script ############################### +# author: Rick Staa +# +# This script performs some actions that normaly the .bashrc script would +# perform. This script is sourced through a runscript. +# +# based on: The script of Zorglub29 at +# https://stackoverflow.com/questions/51037873/bash-script-to-perform-action-in-a-singularity-container-it-opens +######################################################################### + +#################################### +### Main bashrc settings ########### +#################################### +# NOTE: Changes the bash shell behavoir (e.i. adds coloring, ect.) + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in +xterm-color) color_prompt=yes ;; +esac + +# uncomment for a colored prompt, if the terminal has the capability; turned +# off by default to not distract the user: the focus in a terminal window +# should be on the output of commands, not on the prompt +force_color_prompt=yes + +if [ -n "$force_color_prompt" ]; then + if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes + else + color_prompt= + fi +fi +unset color_prompt force_color_prompt + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto' + alias dir='dir --color=auto' + alias vdir='vdir --color=auto' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# Source git bash completion +if [ -f "/usr/share/bash-completion/completions/git" ]; then + source /usr/share/bash-completion/completions/git +fi + +#################################### +### Additional container settings ## +#################################### + +## Source ros enviroment ## +if [ -f "/opt/ros/$ROS_DISTRO/setup.bash" ]; then + . "/opt/ros/$ROS_DISTRO/setup.bash" +fi + +## Source bash aliases ## +if [ -f "/.singularity_bash_aliases" ]; then + . "/.singularity_bash_aliases" +fi + +## Source welcome message .welcome_msg ## +if [ -f "/.welcome_msg" ]; then + . "/.welcome_msg" +fi + +## Source user .singularity_bashrc ## +if [ -f ~/.singularity_bashrc ]; then + . ~/.singularity_bashrc +fi + +## Run script input args ## +exec "$@" \ No newline at end of file diff --git a/singularity/resources/bash_aliases/.singularity_bash_aliases b/singularity/resources/bash_aliases/.singularity_bash_aliases new file mode 100644 index 0000000..fbcecad --- /dev/null +++ b/singularity/resources/bash_aliases/.singularity_bash_aliases @@ -0,0 +1,12 @@ +## Bash aliases ## + +# Default aliases # +alias rsource='. /opt/ros/"$ROS_DISTRO"/setup.bash' +alias rossu='. ./devel/setup.bash' +alias sudo='' + +#_CONTAINER_ALIASES +# Source user aliases # +if [ -f ~/.singularity_bash_aliases ]; then + source ~/.singularity_bash_aliases +fi \ No newline at end of file diff --git a/singularity/resources/welcome_msgs/.ros-melodic.txt b/singularity/resources/welcome_msgs/.ros-melodic.txt new file mode 100644 index 0000000..cc6d4b5 --- /dev/null +++ b/singularity/resources/welcome_msgs/.ros-melodic.txt @@ -0,0 +1,26 @@ +## Container parameters ## +CONT_SITE='https://github.com/rickstaa/COR-robotics-lab-reference' + +## Welcome message ## +export TERM=xterm-256color +echo -e "\e[1;31m" +# FONT=ANSI Shadow +cat<