- start the roscore
roscore
- create your own package in your current working cmake workspace
catkin_create_pkg your_package_name roscpp tf geometry_msgs urdf rviz xacro
- install the urdf and xacro packages
sudo apt-get install ros-melodic-urdf sudo apt-get install ros-melodic-xacro
- Enable the ros to find the path of package , executables and custom files by sourcing it
source devel/setup.bash
- clone the files in this repo to your package folder that you just created
- delete unnecessary files , that include
- cd to your urdf folder
- seven_dof_arm.gv
- seven_dof_arm.pdf
- seven_dof_arm.urdf etc
- cd to your launch folder and change the following line of code in view_arm.launch file, according to your package name that u just created
<param name="robot_description" command="$(find xacro)/xacro --inorder $(find your_package_name)/urdf/seven_dof_arm.xacro" /> ................. ................. ................. <node name="rviz" pkg="rviz" type="rviz" args="-d $(find mastering_ros_robot_description_pkg)/urdf.rviz" required="true" />
- cd to urdf folder and change following line of code in seven_dof_arm.xacro
<xacro:include filename="$(find your_package_name)/urdf/sensors/xtion_pro_live.urdf.xacro"/>
- convert the xacro files to urdf files
rosrun xacro xacro seven_dof_arm.xacro --inorder > seven_dof_arm.urdf
- check for errors in urdf (optional steps)(familirizig the some useful commands)
check_urdf seven_dof_arm.urdf
- visualizing urdf in graph and joint format (optional steps)(familirizig the some useful commands)
urdf_to_graphiz seven_dof_arm.urdf
To view the pdf
envince seven_dof_arm.pdf
when converting to graph and joint format .gv and .pdf files will be automatically create
- launch the rviz and start the node in one go using the launch file that we created
roslaunch your_package_name view_arm.launch
- package folder and files not found
xacro: in-order processing became default in ROS Melodic. You can drop the option.
resource not found: mastering_ros_robot_description_pkg
ROS path [0]=/opt/ros/melodic/share/ros
ROS path [1]=/opt/ros/melodic/share
solution source the package , whenever necesarry
source devel/setup.bash
- cannot view the robot
- on the top left corner change the fixed frame : map to base_link
- finally on the bottom left corner
- click on add
- then click on the robot model option and click ok