This repository contains the codes to control/simulate space-diver.
- ROS 2 Humble
- Git
Create works space to build project.
mkdir spacediver_ws/src -p
cd spacediver_ws/src
Clone this repository and SpaceDyn, which calculates robots' dynamics.
# spacediver_ws/src
git clone --recursive [email protected]:Space-Robotics-Laboratory/space-diver.git
git submodule update --init --recursive
Install required packages using rosdep.
rosdep install -i -y --from-path src
Note
If you have never used rosdep, yo need to initialize it first.
sudo apt install python3-rosdep
sudo rosdep init
rosdep update # do not put sudo here. if you did it mistakenly, fix it by "sudo rosdep fix-permissions"
After installing required packages, build it for the first time!
cd ../ # move to spacediver_ws
colcon build --symlink-install
After you built the project, you can launch gazebo simulation. Before that, you need to copy 3D meshes under .gazebo/models/spacediver
. You can use bash script by running following command.
# At spacediver_ws
. src/spacediver_ros2_control/description/gazebo/models/copy_meshes_to_gazebo.sh
Then, launch it!
# At spacediver_ws
source install/setup.bash
ros2 launch spacediver_ros2_control spacediver.launch.py
space-diver
|- SpaceDyn: Dynamics calculation library
|- floating_robot_controller: Control end-effector velocity/trajectory of floating robot, using functions of SpaceDyn.
|- floating_robot_interfaces: Provides ros2 interface lime msg/action for floating_robot_controller.
|- spacediver_ros2_control : Contains setup files to call ros2_control, ros2_controller, and gazebo for ros2 control. Robot model like urdf, sdf should be here.
Check SpaceDyn github repository.
This is a ros2 package which provides end-effector-trajectory-controller action node. You can make your own action client to ask controller to calculate required joint velocity/effort to follow desired point.
Contains interfaces below. They are mainly used in floating robot controller to control end-effector-trajectory.
- EndEffectorTrajectory.msg
- EndEffectorTrajectoryPoint.msg
- FollowEndEffectorTrajectory.action
spacediver_ros2_control
|- bringup
|- config
|- spacediver_controllers.yaml: Setting file for ros2 controller, controller name and control gains for example.
|- launch
|- spacediver.launch.py: Launch robot system with calling ros2 control controller manager.
|- description
|- gazebo
|- models: Gazebo models written in sdf. It can have different structure from urdf to explain closed link structure, but should have the same joint name.
|- worlds: World setting.
|-ros2_control: Setting files to use ros2 control, setting of joint limit for example.
|- rviz: Store config.rviz file. These are generated by rviz when you select `save as` in gui.
|- urdf: Robot model defined in ros2 architecture. Rviz, ros2 controller and SpaceDyn refer them.
Create a branch following the naming rule as feature/*******
.
git checkout feature/******* -b
Important
It's important to avoid developing directory under develop branch, nor main branch.
This command will run colcon test for all packages except for spacedyn_ros
.jo
colcon build && colcon test --packages-ignore 'spacedyn_ros' 'spd_example' && colcon test-result --verbose