ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

custom robot not moving diff drive plugin

asked 2022-01-17 00:11:42 -0500

cjoshi17 gravatar image

updated 2022-01-17 00:20:17 -0500

Hello,

I am trying to simulate a custom robot. I am using ROS Noetic. Please find my gazebo file where I have added the plugin and my urdf file as well

<?xml version="1.0"?>
<robot name="rseries_bot" xmlns:xacro="http://ros.org/wiki/xacro">
  <xacro:include filename="$(find multibot_simulation)/urdf/rseries_bot.gazebo.xacro"/>

  <!-- ****************** ROBOT CONSTANTS *******************************  -->
  <xacro:property name="base_width" value="0.42"/>
  <xacro:property name="base_length" value="0.40"/>
  <xacro:property name="base_height" value="0.20"/>
  <xacro:property name="wheel_radius" value="0.0825"/>
  <xacro:property name="wheel_width" value="0.05"/>
  <xacro:property name="wheel_ygap" value="0.15"/>
  <xacro:property name="wheel_zoff" value="0.0"/>
  <xacro:property name="wheel_xoff" value="0.0"/>
  <xacro:property name="caster_xoff" value="0.217"/>
  <xacro:macro name="box_inertia" params="m w h d">
    <inertial>
      <origin xyz="0 0 0" rpy="${pi/2} 0 ${pi/2}"/>
      <mass value="${m}"/>
      <inertia ixx="${(m/12) * (h*h + d*d)}" ixy="0.0" ixz="0.0" iyy="${(m/12) * (w*w + d*d)}" iyz="0.0" izz="${(m/12) * (w*w +h*h)}"/>
    </inertial>
  </xacro:macro>

  <xacro:macro name="cylinder_inertia" params="m r h">
    <inertial>
      <origin xyz="0 0 0" rpy="${pi/2} 0 0" />
      <mass value="${m}"/>
      <inertia ixx="${(m/12) * (3*r*r + h*h)}" ixy = "0" ixz = "0" iyy="${(m/12) * (3*r*r + h*h)}" iyz = "0" izz="${(m/2) * (r*r)}"/>
    </inertial>
  </xacro:macro>

  <xacro:macro name="sphere_inertia" params="m r">
    <inertial>
      <mass value="${m}"/>
      <inertia ixx="${(2/5) * m * (r*r)}" ixy="0.0" ixz="0.0" iyy="${(2/5) * m * (r*r)}" iyz="0.0" izz="${(2/5) * m * (r*r)}"/>
    </inertial>
  </xacro:macro>

  <!-- ********************** ROBOT BASE *********************************  -->
  <link name="base_link">
    <visual>
      <origin xyz="0.0 0.0 0.08" rpy="0 0 0"/>
      <geometry>
        <mesh filename="package://multibot_simulation/mesh/robochef_body_final.stl" scale="0.0015 0.0015 0.0015"/>
      </geometry>
      <color rgba="${0/255} ${0/255} ${255/255} 1.0"/>
    </visual>

    <collision>
      <geometry>
        <box size="${base_length} ${base_width} ${base_height}"/>
      </geometry>
    </collision>

    <xacro:box_inertia m="20.0" w="${base_width}" d="${base_length}" h="${base_height}"/> 

  </link>

  <!-- *********************** DRIVE WHEELS ******************************  -->
  <link name="left_wheel_link">
    <visual>
      <origin xyz="0 0 0" rpy="1.5707963267949 0 0"/>
      <geometry>
        <mesh filename="package://multibot_simulation/mesh/wheel.stl" scale="0.0013 0.0013 0.0013"/>
      </geometry>
      <material name="White">
        <color rgba="${255/255} ${255/255} ${255/255} 1.0"/>
      </material>
    </visual>

    <collision>
      <origin xyz="0 0 0" rpy="${pi/2} 0 0"/>
        <geometry>
          <cylinder radius="${wheel_radius}" length="${wheel_width}"/>
        </geometry>
    </collision>

    <xacro:cylinder_inertia m="5.5" r="${wheel_radius}" h="${wheel_width}"/>

    </link>

    <joint name="left_wheel_joint" type="revolute">
      <parent link="base_link"/>
      <child link="left_wheel_link"/>
      <origin xyz="0.0 0.19 0.0" rpy="0 0 ...
(more)
edit retag flag offensive close merge delete

Comments

I have changed motor joints from revolute to continuous but it still didn't work. I followed the URDF from mastering ROS and it somehow worked

cjoshi17 gravatar image cjoshi17  ( 2022-01-17 06:43:21 -0500 )edit

Sorry it should work we both, that's why I deleted the comment.

osilva gravatar image osilva  ( 2022-01-17 08:31:00 -0500 )edit

There isn't really any information here to help answer your question. Is there any specific error you're seeing? Any tutorial you're following? Any configuration file you're using?

cst0 gravatar image cst0  ( 2022-01-17 21:06:41 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-01-18 05:51:52 -0500

Robo_guy gravatar image

updated 2022-01-18 05:53:02 -0500

Try changing both the left and right wheel joint's effort and velocity values to 10 or 100, doing this should solve your problem. I had encountered a similar problem and doing this had solved it for me.

edit flag offensive delete link more

Comments

@cjoshi17 did you try doing this ? Did it solve your problem ?

Robo_guy gravatar image Robo_guy  ( 2022-01-24 07:27:15 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2022-01-17 00:11:42 -0500

Seen: 86 times

Last updated: Jan 18 '22