Published On Dec 19, 2023
Learn how to seamlessly export a 3D Robot Model from Onshape to ROS2 using URDF in this comprehensive tutorial.
π€οΈ Related courses:
* URDF for Robot Modeling in ROS2 full course https://app.theconstructsim.com/cours...
* Robotics Developer Masterclass 2024: https://www.theconstructsim.com/robot...
* Use this rosject: https://app.theconstructsim.com/l/5ee...
* Post with the written version of this video: https://bit.ly/3vRySfi
00:00:40 Step 1: Create an onshape account (https://www.onshape.com/en/)
00:00:56 Step 2: Install the module onshape-to-robot
00:06:52 Step 3: Use the onshape-to-robot module to export the robot model from OnShape to URDF file
00:07:30 Step 4: How to setup our ROS2 package
00:08:44 Step 5: Publish the robot model description generated in ROS2 and see it in RVIZ2
π₯οΈ Commands used in this tutorial:
Install onSHape to Urdf python module
sudo pip install onshape-to-robot
Or you can install it in a virtual environment of python
python -m venv onshape_venv
source onshape_venv/bin/activate
You should see now in your linux promt the (onshape_venv)
pip install onshape-to-robot
β
Install Dependencies
sudo add-apt-repository ppa:openscad/releases
sudo apt-get update
sudo apt-get install openscad -y
sudo apt-get install meshlab -y
β
Add the OnShapeKeys to the `keys.sh` file
cd ~/ros2_ws
touch keys.sh
chmod +x keys.sh
β
Source the keys and check
cd ~/ros2_ws
source keys.sh
echo $ONSHAPE_API
echo $ONSHAPE_ACCESS_KEY
echo $ONSHAPE_SECRET_KEY
β
Create the ROS2 package and some folders
cd ~/ros2_ws/src
ros2 pkg create --build-type ament_cmake quadruped_description --dependencies urdf xacro
cd quadruped_description
mkdir quadruped
touch quadruped/config.json
β
mkdir launch
mkdir rviz
β
Export form OnShape to URDF file
cd ~/ros2_ws/src/quadruped_description
Execute th export
onshape-to-robot quadruped
β
Create launch files
cd ~/ros2_ws/src/quadruped_description
touch launch/quadruped.launch.py
touch launch/start_rviz.launch.py
touch rviz/quadruped.rviz
β
Build
cd ~/ros2_ws/
source install/setup.bash
colcon build --packages-select quadruped_description
source install/setup.bash
β
Launch Generated system
cd ~/ros2_ws/
source install/setup.bash
ros2 launch quadruped_description quadruped.launch.py
β
cd ~/ros2_ws/
source install/setup.bash
ros2 launch quadruped_description start_rviz.launch.py
β
cd ~/ros2_ws/
source install/setup.bash
ros2 run joint_state_publisher_gui joint_state_publisher_gui
--
#ROS #Robot #ROStutorials