Gazebo | Ignition | Community
Ask Your Question

kumpakri's profile - activity

2023-05-17 17:28:09 -0500 received badge  Famous Question (source)
2023-05-17 17:28:09 -0500 received badge  Popular Question (source)
2023-05-17 17:28:09 -0500 received badge  Notable Question (source)
2023-01-29 16:07:59 -0500 received badge  Famous Question (source)
2022-05-20 14:55:38 -0500 marked best answer Velocity controllers and missing P gain

I am using the VelocityJointController from velocity_controllers to control a robot loaded in Gazebo simulation. I specify PID gains in a .yaml file. However when I launch the simulation, the error pops out

[ERROR] [1546601044.601198350, 0.165000000]: No p gain specified for pid.  Namespace: /robot/gazebo_ros_control/pid_gains/joint_rear_left_wheel

And no metter what PID gains I set, the robot behaves always the same. The PID gains set in .yaml configuration file has no effect on the simulation.

my transmission:

<transmission name="tran_rear_left_wheel">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="joint_rear_left_wheel">
        <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
    </joint>
    <actuator name="motor_rear_left_wheel">
        <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
        <mechanicalReduction>1</mechanicalReduction>
    </actuator>
</transmission>

control yaml

imow:
  # Publish all joint states -----------------------------------
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50  

  # Velocity Controllers -----------------------------------------
  joint_rear_left_wheel_controller:
    type: velocity_controllers/JointVelocityController
    joint: joint_rear_left_wheel
    pid: {p: 1, i: 1, d: 1}

What is happening?

2022-05-19 03:14:51 -0500 received badge  Famous Question (source)
2022-04-05 08:30:09 -0500 received badge  Famous Question (source)
2022-04-05 08:30:05 -0500 received badge  Famous Question (source)
2022-04-05 08:30:05 -0500 received badge  Notable Question (source)
2022-02-24 09:40:28 -0500 marked best answer How to set a model's position using /gazebo/set_model_state service in python

I want to set a model's position to origin after each measure loop, so that I can make automatically several measurements in the same conditions.

The /gazebo/set_model_state service enables us to transport the model to set position. How do I use it in python node?

2022-02-24 09:40:28 -0500 received badge  Self-Learner (source)
2022-02-16 07:27:41 -0500 received badge  Notable Question (source)
2022-01-08 21:18:53 -0500 received badge  Famous Question (source)
2021-12-31 04:31:10 -0500 received badge  Popular Question (source)
2021-09-08 22:18:51 -0500 received badge  Famous Question (source)
2021-09-08 22:12:49 -0500 received badge  Taxonomist
2021-09-08 05:58:30 -0500 received badge  Notable Question (source)
2021-09-08 05:58:30 -0500 received badge  Popular Question (source)
2021-09-02 10:42:54 -0500 received badge  Notable Question (source)
2021-08-30 02:44:18 -0500 received badge  Famous Question (source)
2021-07-18 07:00:16 -0500 received badge  Popular Question (source)
2021-06-14 10:41:31 -0500 marked best answer How to achieve planar joint?

I need to define a joint that is moving in x-y plane but is fixed in z plane. On ROS wiki page, there is a list of joints, which says a planar type of joint can be defined, but if I run the model in Gazebo simulation, it says the type of joint is unknown.

[ WARN] [1539099575.602332867]: Converting unknown joint type of joint 'joint_planar' into a fixed joint

I have defined two link each of which I assigned a prismatic joint, one in y axis, the other in x axis. If I could somehow use one mesh for the both links, it would be sufficient, but I can't imagine how could that be possible.

I need a way how to make my mesh element move in plane in Gazebo simulation. How can I do that?

2021-05-19 03:21:25 -0500 received badge  Famous Question (source)
2021-03-01 13:14:16 -0500 marked best answer Can I run two gazebo_ros_control plugins in one simulation?

I run a simulation into which I spawn a robot with gazebo_ros_control plugin called simply "gazebo_ros_control". This loads all successfully. Then there is a model inside the world which has gazebo_ros_control plugin. This one only starts the joint_states topic, but not the command, pid and state topic for each joint individually.

plugin of the model inside the world:

  <transmission name="tran_robotic_arm">
    <type>transmission_interface/SimpleTransmission</type>
    <joint name="arm_base_joint1">
      <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
    </joint>
    <actuator name="arm_base_motor">
      <hardwareInterface>hardware_interface/VelocityJointInterface</hardwareInterface>
      <mechanicalReduction>1</mechanicalReduction>
    </actuator>
  </transmission>

  <plugin name="testbench_control" filename="libgazebo_ros_control.so">
    <robotNamespace>/testbench</robotNamespace>
    <robotSimType>gazebo_ros_control/DefaultRobotHWSim</robotSimType>
    <legacyModeNS>true</legacyModeNS>
  </plugin>

control yaml

testbench:
  joint_state_controller:
    type: joint_state_controller/JointStateController
    publish_rate: 50  

  arm_base_joint1_controller:
    type: velocity_controllers/JointVelocityController
    joint: arm_base_joint1
    pid: {p: 10.0, i: 0.1, d: 0.01}

control launch file:

<launch>

  <!-- Load joint controller configurations from YAML file to parameter server -->
  <rosparam file="$(find testbench_control)/config/control.yaml" command="load"/>

  <!-- load the controllers -->
  <node name="controller_spawner" pkg="controller_manager" type="spawner" respawn="false"
    output="screen" ns="/testbench" args=" joint_state_controller
                                      arm_base_joint1_controller" />

  <!-- convert joint states to TF transforms for rviz, etc -->
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"
    respawn="false" output="screen">
    <remap from="/joint_states" to="/testbench/joint_states" />
  </node>

</launch>

launch file

<?xml version="1.0"?>
<launch>
    <!-- testbench ros_control launch file -->
    <!-- creates topics for joints state and joint controller -->
    <include file="$(find testbench_control)/launch/control.launch" />
</launch>

I launch this launch file after the simulation is all loaded. I want to use the /testbench/arm_base_joint1_controller/command topic to control the robotic arm joint. Is it possible? What am I doing wrong?

2021-02-24 11:23:52 -0500 received badge  Famous Question (source)
2021-01-30 07:39:03 -0500 received badge  Notable Question (source)
2021-01-30 07:39:03 -0500 received badge  Famous Question (source)
2021-01-20 09:57:06 -0500 received badge  Popular Question (source)
2021-01-20 09:57:06 -0500 received badge  Notable Question (source)
2021-01-05 23:12:24 -0500 received badge  Notable Question (source)
2020-12-16 22:36:13 -0500 received badge  Famous Question (source)
2020-09-14 03:23:12 -0500 received badge  Famous Question (source)
2020-09-14 03:23:12 -0500 received badge  Notable Question (source)
2020-09-10 10:16:03 -0500 received badge  Famous Question (source)
2020-09-03 03:49:26 -0500 received badge  Notable Question (source)
2020-09-02 10:06:30 -0500 received badge  Notable Question (source)
2020-08-27 02:16:02 -0500 received badge  Popular Question (source)
2020-08-25 08:36:56 -0500 commented answer Running multiple Gazebo simulations on one ROS core

From the list of branches it seems that this package was only developed for ROS 1 so far. The newest branch is noetic.

2020-08-24 10:45:07 -0500 marked best answer Running multiple Gazebo simulations on one ROS core

Is it possible to run multiple Gazebo simulation with one ROS core and be able to interact with all the simulation (read and sent messages)?

If so, what is needed in order for this to work?


EDIT 1

I have manage to run two simulation by putting

export GAZEBO_MASTER_URI=http://localhost:11346;

before launching the second simulation and launching each simulation in different group.

<?xml version="1.0"?>
<launch>
    <!-- define arguments -->
    ...
    <!-- startup gazebo WORLD -->
   ...
   <group ns="$(arg group_name)">
        <param name="robot_description"
            command="$(find xacro)/xacro --inorder '$(find robot_gazebo)/launch/upload_robot.xacro'" />
        <node name="urdf_spawner_$(arg group_name)" pkg="gazebo_ros" type="spawn_model" respawn="false" output="screen"
            args="-urdf -model robot_$(arg group_name) -param robot_description -x $(arg robot_x) -y $(arg robot_y) -z $(arg robot_z)"/>
        <include file="$(find robot_control)/launch/$(arg group_name)_control.launch" if="$(eval control)" >
        </include>
    </group>
</launch>

I need to use the same model. To be sure I made duplicate model and named it according to the group name. I have made separate control launches for both models and set the gazebo_ros_control controllers into different namespaces.

When I launch the first simulation, it loads as normally and all the controllers loads. As soon as I run the second simulation, however, the controllers case to exist in topic list and only 3 controller topics out of 8 expected appears on rostopic list for the second robot: the 2nd_robot/joint_states and 2nd_robot/left_wheel/command and 2nd_robot/right_wheel/command (EDIT 3: This number of topics for the second robot is actually right, because I'm using the VelocityJointInterface). Only 1st_robot/joint_states remains for the first robot.

So I have two simulations running with a robot loaded, but I can't control either of the robots (EDIT 3: I can control one of the robot, the second). How do I fix this?


EDIT 2

I have even run each Gazebo simulation on different ROS core using the multimaster-fkie package, so each Gazebo simulation has different GAZEBO_MASTER_URI and ROS_MASTER_URI, yet the behavior is still the same.

2020-08-24 08:13:50 -0500 marked best answer ROS node from Gazebo plugin is not showing in the rosnode list

I want to publish some topics from a Gazebo model plugin to the ROS topic, so I use the C++ ROS node initiation code from some example that I now only copy-paste to all plugins I need.

// Initialize ros, if it has not already been initialized.
std::string node_name = std::string("my_node_name");
if (!ros::isInitialized()) {
  int argc = 0;
  char **argv = nullptr;

  ros::init(argc, argv, node_name. ros::init_options::NoSigintHandler);
}

// Create ROS node.
this->rosNode.reset(new ros::NodeHandle(node_name));

topic_name = "/my_topic";
this->rosPublisher = this->rosNode->advertise<std_msgs::Float64>(topic_name, 1);

The /my_topic topic is registered (I can see it in the rostopic list), I publish to the topic messages on every update (I debugged that the code is being executed, so the messages are being send in the plugin) but when I use rostopic echo /my_node nothing is being printed.

Also using rosnode list shows me no /my_node_name node. I'm thinking the node either isn't created at all, or shuts down. I don't know. How can I check for that, or launch the node correctly, or what else could be going wrong?

2020-08-24 08:13:38 -0500 commented answer ROS node from Gazebo plugin is not showing in the rosnode list

I be damned but this approach actually solved the issue with messages not being printed from the echo. Thank you.