[ROS Q&A] 075 – 3rd time getting stuck at “Building a ROS Package”

[ROS Q&A] 075 – 3rd time getting stuck at “Building a ROS Package”

 

In this question we see how to solve the problem when running catkin_make on a Catkin Workspace: The specified base path /home/user/catkin_ws contains a CMakeLists.txt but catkin_make must be invoked in the root of workspace

Q: https://answers.ros.org/question/277210/3rd-time-getting-stuck-at-building-a-ros-package/

A: The problem is because the user had a CMakeLists.txt on the root folder of the Workspace (~/catkin_ws/CMakeLists.txt). The file must be on the src folder: ~/catkin_ws/src/CMakeLists.txt

 

[ROS Q&A] 074 – Aerodynamic parameters of lift-drag plugin part2

[ROS Q&A] 074 – Aerodynamic parameters of lift-drag plugin part2

 

In this video we complete the answer given previously ( https://www.youtube.com/watch?v=I-dhwqxV7QM ) with a more complex shape. Here is the question: http://answers.gazebosim.org/question/15331/need-information-on-aerodynamic-parameters-of-lift-drag-plugin/#17793

Q: Need information on aerodynamic parameters of lift-drag plugin
A: You have to calculate the area for the new shapes and also decide the axis for the front and upwards forces.

 

[ROS Q&A] 072 – How to check your complex URDF

[ROS Q&A] 072 – How to check your complex URDF

 

When developing for ROS, you will have to create the URDF of your robot. If your robot is complex and contains lots of different joints, you would like to test how is it going and if you are building the model properly. Here we provide you with a method to check the status of your robot URDF model.

Related ROS Answers Question: https://answers.ros.org/question/187815/how-do-i-display-my-own-urdf-in-rviz/

Related courses:
1- Understanding TF: https://www.theconstruct.ai/construct-learn-develop-robots-using-ros/robotigniteacademy_learnros/ros-courses-library/tf-ros-101/

2- URDF creation in detail: https://www.theconstruct.ai/construct-learn-develop-robots-using-ros/robotigniteacademy_learnros/ros-courses-library/robot-creation-with-urdf/

 

Related course

TF ROS Course Cover - ROS Online Courses - Robot Ignite Academy

TF ROS Course

[ROS Q&A] 070 – Moving Joints in Gazebo Simple Example

[ROS Q&A] 070 – Moving Joints in Gazebo Simple Example

Today’s ROS Question:

Moving Joints in Gazebo simple example? (https://answers.ros.org/question/273947/moving-joints-in-gazebo-simple-example/)

Answers:

You have to create the URDF, add the ros control plugin, and include a config file to configure the plugin. Let’s see how to do it step-by-step:

 

Step 0. Create a project in ROS Development Studio(ROSDS)

ROSDS helps you follow our tutorial in a fast pace without dealing without setting up an environment locally. If you haven’t had an account yet, you can create a free account here. Please create a ROSject then open it.

Step 1. Create a URDF model

At first, let’s create a package for our code.

cd ~/catkin_ws/src
catkin_create_pkg simple_example_description ropy
cd simple_example_dexcription
mkdir launch
mkdir config
mkdir urdf

Then we create a URDF description called robot.urdf under the urdf folder with the following content

<?xml version="1.0"?>
<robot name="simple_example">
  <link name="base_link">
    <inertial>
        <mass value="10" />
        <inertia ixx="0.4" ixy="0.0" ixz="0.0" iyy="0.4" iyz="0.0" izz="0.2"/>
    </inertial>
    <collision>
      <geometry>
        <cylinder radius="0.05" length="0.24" />
      </geometry>
        </collision>
    <visual>
      <geometry>
        <cylinder radius="0.05" length="0.24" />
      </geometry>
    </visual>
  </link>

  <link name="second_link">
    <inertial>
        <mass value="0.18" />
        <inertia ixx="0.0002835" ixy="0.0" ixz="0.0" iyy="0.0002835" iyz="0.0" izz="0.000324" />
    </inertial>
    <origin rpy="0.0 0.0 0.0" xyz="0.0 0.0 0.0" />
    <collision>
      <geometry>
        <box size="0.05 0.05 0.15" />
      </geometry>
    </collision>
    <visual>
      <geometry>
        <box size="0.05 0.05 0.15" />
      </geometry>
    </visual>
  </link>

  <joint name="base_to_second_joint" type="continuous">
    <parent link="base_link"/>
    <child link="second_link"/>
    <axis xyz="1 0 0"/>
    <origin xyz="0.0 0.0 0.2" rpy="0.0 0.0 0.0"/> 
  </joint>

  <!--                GAZEBO RELATED PART                             -->

  <!-- ROS Control plugin for Gazebo -->
  <gazebo>
    <plugin name="gazebo_ros_control" filename="libgazebo_ros_control.so">
      <robotNamespace>/simple_model</robotNamespace>
    </plugin>
  </gazebo>

  <!-- transmission -->
  <transmission name="base_to_second_trans">
    <type>transmission_interface/SimpleTransmission</type>
    <actuator name="motor1">
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
    <joint name="base_to_second_joint">
      <hardwareInterface>EffortJointInterface</hardwareInterface>
    </joint>
  </transmission>
</robot>`

This description creates a 2 links robot.

For each link, there are 3 parts: inertia define the physical property of the link, the collision part define the behavior while collision occurs, and the visual part define the visualization of the link in the simulation.

Since we also want to control the robot, we have to include the gazebo plugin and define the type of the transmission.

Then we also need a config.yaml file under the config folder for the parameter of the controller with the following content.

simple_model:
joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 20

base_to_second_joint_position_controller:
    type: effor_controllers/JointPositionController
    joint: base_to_second_joint
    pid: {p: 1.0, i: 1.0, d: 0.0}

The last step is to create a launch file to launch everything. We’ll call it spawn_robot.launch and put it under the launch folder.

<launch>
    <param name="robot_decription" textfile="$(find simple_example_description)/urdf/robot.urdf" />

    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen" args="-urdf -model simple_model -param robot_description -y -6"/>
    <!-- load the controllers -->
    <rosparam file="$(find simple_example_description)/config/config.yaml" command="load"/>
    <node name="controller_spawner" pkg ="controller_manager" type="spawner" ns="/simple_model" args="base_to_second_joint_position_controller joint_state_controller --shutdown-timeout 3"/>
    <!-- converts joint states to TF transforms -->
    <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" respawn="false" output="screen">
        <remap from="joint_state" to="/simple_model/joint_states" />
    </node>
</launch>

Let’s start an empty simulation from Simulations->Empty then launch the launch file with

roslaunch simple_example_description spawn_robot.launch

You should see the robot is spawned in the center of the simulation world.

You can try to control the robot by publishing to the topic

rostopic pub -1 /simple_model/base_to_second_joint_position_controller/command std_msgs/Float64 "date: 3"

The robot is moving now!

 

Related resources:

 

Edit by: Tony Huang

Pin It on Pinterest