How to Export a 3D Robot Model to ROS2 | Onshape CAD to URDF
The Construct The Construct
48K subscribers
2,482 views
0

 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

show more

Share/Embed