Skip to content

AISciencePlatform/aisp_ros_control_template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aisp_ros_control_template

Installation on Ubuntu 20.04 x64 LTS

1. Pre-requisites

sudo apt update && sudo apt upgrade -y
sudo apt install qt5-default git terminator cmake python3-pip libeigen3-dev mesa-common-dev libglu1-mesa-dev curl jq -y
python3 -m pip install scipy

2. DQ Robotics library (development PPA)

sudo add-apt-repository ppa:dqrobotics-dev/development -y
sudo apt-get update
sudo apt-get install libdqrobotics*
python3 -m pip install --user --pre dqrobotics
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt update
sudo apt install ros-noetic-ros-base ros-noetic-pybind11-catkin -y

4. Catkin tools

sudo python3 -m pip install git+https://github.com/catkin/catkin_tools.git
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin config --profile release -x _release --cmake-args -DCMAKE_BUILD_TYPE=Release
catkin build --profile release
cd ~/Downloads
git clone https://github.com/coin-or/qpOASES.git
cd qpOASES
sed -i -e 's/option(BUILD_SHARED_LIBS "If ON, build shared library instead of static" OFF)/option(BUILD_SHARED_LIBS "If ON, build shared library instead of static" ON)/g' CMakeLists.txt
mkdir build
cd build
cmake ..
make -j20
sudo make install
sudo ldconfig
wget https://raw.githubusercontent.com/SmartArmStack/smart_arm_stack/main/install.sh
sh install.sh

Clone this repository

cd ~/catkin_ws/src
git clone https://github.com/AISciencePlatform/aisp_ros_control_template.git

Set the enviroment variables for your particular system

Variable Meaning
VREP_IP CoppeliaSim's computer IP.
ROBOT_1_JSON_PATH Usually /home/user_name/catkin_ws/src/aisp_ros_control_template/robots/aisp_cobotta_robot_1.json
ROBOT_2_JSON_PATH Usually /home/user_name/catkin_ws/src/aisp_ros_control_template/robots/aisp_cobotta_robot_2.json
ROBOT_3_JSON_PATH Usually /home/user_name/catkin_ws/src/aisp_ros_control_template/robots/aisp_vs050_robot_1.json
ROBOT_4_JSON_PATH Usually /home/user_name/catkin_ws/src/aisp_ros_control_template/robots/aisp_vs050_robot_2.json

Example:

In this example the user is ubuntu and the aisp_ros_control_template folder is in /home/ubuntu/catkin_ws/src/aisp_ros_control_template. Furthermore, the CoppeliaSim scene is on the same computer.

echo "export VREP_IP=127.0.0.1" >> ~/.bashrc
echo 'export ROBOT_1_JSON_PATH="/home/ubuntu/catkin_ws/src/aisp_ros_control_template/robots/aisp_cobotta_robot_1.json"' >> ~/.bashrc
echo 'export ROBOT_2_JSON_PATH="/home/ubuntu/catkin_ws/src/aisp_ros_control_template/robots/aisp_cobotta_robot_2.json"'  >> ~/.bashrc
echo 'export ROBOT_3_JSON_PATH="/home/ubuntu/catkin_ws/src/aisp_ros_control_template/robots/aisp_vs050_robot_1.json"' >> ~/.bashrc
echo 'export ROBOT_4_JSON_PATH="/home/ubuntu/catkin_ws/src/aisp_ros_control_template/robots/aisp_vs050_robot_2.json"'  >> ~/.bashrc

Open the CoppeliaSim scene

  • Follow the instructions here to set up CoppeliaSim and open the scene.

Screenshot 2022-11-10 125810

  • Click on ⏹️ to make sure the simulation is not running.

Running the ROS node infrastructure.

Open a new terminal and type:

cd ~/catkin_ws/
source devel/setup.bash
roslaunch aisp_ros_control_template run_simulation.launch --screen

You can stop the program by pressing CTRC+C at any time on this terminal.

Running the motion script example.

Open a new terminal and type:

cd ~/catkin_ws/
source devel/setup.bash
rosrun aisp_ros_control_template aisp_kinematic_control_example.py

Modify the aisp_kinematic_control_example.py according to your needs.