Activity
URDF
- Clone
https://github.com/m-elwin/me495_urdf.git
- In addition to being used for this activity, the file contains a few examples of xacro files and launch files.
- Use the
see_robot.launch.xml launchfile to run the demonstration.
- This launchfile should start
rviz2 and the joint_state_publisher_gui
- In a new terminal window
ros2 topic echo the /joint_states
- Slide the sliders for the
linear and rotational joints in the gui
- What happens in
rviz?
- What happens to the
joint_states messages?
- Pass arguments to
see_robot.launch.xml so that it loads a different robot.
- Change
see_robot.launch.xml so it no longer loads the rviz configuration
- When
rviz loads, set it up to see the robot
- Set the fixed frame
- Add a "Robot Model" object
- Set the "Robot Model" object's "Description Source" to "topic"
- Set the "Robot Model" object's "Description topic" to "/robot_description"
- Rename
slidebot.urdf to slidebot.urdf.xacro (mv slidebot.urdf slidebot.urdf.xacro)
- Add a rotational joint and another cylindrical link to the end of the slidebot's blue cylindrical link
- The link should be green
- The link should rotate in the same plane as the blue cylindrical link
Xacro
- Modify
slidebot.urdf.xacro so that it is a valid xacro file
- Add
xmlns:xacro="http://wiki.ros.org/wiki/xacro" to the robot tag
- Create a parameter called
base_radius and use it as the radius of the base sphere
- Declare this parameter directly as a
xacro:property
- Make the length of the arm 10 times the radius of the
base sphere using a formula in xacro
- Using the information in xacro YAML
- load the
base_radius from a yaml file instead of declaring it directly in the xacro file.
- Use a
xacro:macro to add a link to the arm that is the same as the current arm link but on the opposite side of the body