im also unable to find odom in the Rviz2.
i tried copying all required files from updated git profile but still not able to get the odom in the Rviz
I have another issue. Everything works fine except the last one bit. When i try to launch gazebo with the obstacles, they just donāt show up in the simulation. Do i need to download/create a my.world file first or is it just a bug?
hi, iām trying to add another pair of wheel instead of caster wheel, and the rviz model work just fine. however in gazebo the second pair doesnāt show up. Anyone knows why so?
the second part of the question is, if i want the new pair just to āfollowā the vehicle, what should i change in gazebo_control file?
Yeah you will need to create your own world file (which I think I cover in the video? I havenāt got time to check now). Or you could download one like this.
Hmm, if the other pair does not turn (e.g. ackermann steering) then you will encounter some issues due to friction but it should still kind of work. Are you thinking these other wheels will be driven or free-spinning?
Make sure you have unique names for all your joints and links and they are located in the correct spot (I suppose you say it is fine in RViz). They donāt show up in the model tree on the left side of Gazebo?
no the wheels donāt turn. and though theyāll be driven afterwards for simplification i want to simulate them as free-spinning. itās actually thought as kid of a truck to the main robot.
Thatās correct, they donāt show up in the model tree only in gazebo. Here are the two cases of the parts 2&3:
- I can launch rsp launch file with joint_state_publisher_gui and everything works correctly in rviz
- If i launch sim file, then the second pair of wheel doesnāt show up in gazebo, though in terminal all the links are started. If i start the rviz in that case the whole ātruckā-part is white unless i start the joint_state_publisher_gui. After that it is visualized correctly in rviz (but still not in gazebo)
i canāt find any infos about the plugin you are using here. any help?
Make sure that everything is spelled correctly. Itās bit of a pain in the arse to go through everything but I had a āno transform from wheel link to odomā error and found out that I had put in <publish_wheel_transform> instead of <publish_wheel_tf>. I have made a few silly mistakes like that so definitely worth going over all the code and make sure that everything is correct as theyāre easy mistakes to make.
hello i downloaded the repository and iām facing similar issues, iām unable to move the robot at all through teleop_twist, iām using ros2 foxy on ubuntu 20.04 LTS any ideas?
for additional info it is publishing the commands but its not doing anything
(I found out that it spits out āController manager not availableā in the terminal)
did u find a solution ??
Hi all,
Use this xacro in the file gazebo_control.xacro
The problem is due to the incorrect tag usage in the original code. The incorrect tags have been commented and substituted with correct ones.
All the Best !
References:
https://classic.gazebosim.org/tutorials?tut=ros_gzplugins See the section Differential Drive
https://github.com/ros-simulation/gazebo_ros_pkgs/blob/noetic-devel/gazebo_plugins/src/gazebo_ros_diff_drive.cpp
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="jim_bot1">
<gazebo>
<plugin name='differential_drive_controller' filename='libgazebo_ros_diff_drive.so'>
<!-- Plugin update rate in Hz -->
<updateRate>10</updateRate>
<!-- Wheel Information -->
<leftJoint>left_wheel_joint</leftJoint>
<rightJoint>right_wheel_joint</rightJoint>
<wheelSeparation>0.35</wheelSeparation>
<wheelDiameter>0.1</wheelDiameter>
<!-- Limits -->
<wheelTorque>200</wheelTorque>
<wheelAcceleration>10.0</wheelAcceleration>
<!-- Output -->
<!-- <odometry_frame>odom</odometry_frame> -->
<odometryFrame>odom</odometryFrame>
<!-- <robot_base_frame>base_link</robot_base_frame> -->
<robotBaseFrame>base_link</robotBaseFrame>
<!-- <publish_odom_tf>true</publish_odom_tf> -->
<publishOdomTF>true</publishOdomTF>
<!-- <publish_wheel_tf>true</publish_wheel_tf> -->
<publishWheelTF>true</publishWheelTF>
</plugin>
</gazebo>
</robot>
We should not forget to use Joint_State_Publisher Node!!!
Hi all, I have a problem . When i run teleop_twist_keyboard and press u i o key but nothing happened in gazebo . I canāt move the robot .
my diff_drive canāt sub to /cmd_vel . Please help
Yes, you are correct.
Kindly find the updated xacro file
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" name="jim_bot">
<gazebo>
<plugin name='differential_drive_controller' filename='libgazebo_ros_diff_drive.so'>
<!-- Misc configs-->
<alwaysOn>true</alwaysOn>
<legacyMode>false</legacyMode>
<updateRate>10</updateRate>
<rosDebugLevel>na</rosDebugLevel>
<!-- Wheel Information -->
<wheelSeparation>0.155</wheelSeparation>
<wheelDiameter>0.066</wheelDiameter>
<!-- Joints -->
<leftJoint>left_wheel_joint</leftJoint>
<rightJoint>right_wheel_joint</rightJoint>
<!-- Limits -->
<wheelTorque>10</wheelTorque>
<wheelAcceleration>2.0</wheelAcceleration>
<torque>5</torque>
<!-- topics -->
<commandTopic>cmd_vel</commandTopic>
<odometryTopic>odom</odometryTopic>
<odometrySource>world</odometrySource> <!-- odometrySource options "world" "encoder" -->
<!-- Frames -->
<odometryFrame>odom</odometryFrame>
<robotBaseFrame>base_link</robotBaseFrame>
<!-- outputs -->
<publishTf>1</publishTf>
<publishOdomTF>true</publishOdomTF>
<publishWheelTF>true</publishWheelTF>
<publishWheelJointState>true</publishWheelJointState>
</plugin>
</gazebo>
</robot>
Main question: How do I fix a link to the Gazebo world so itās immobile?
Background:
Iāve gone through all the non-physical parts of Making a Mobile Robot before, with a lot of success.
Iām now at the point I want to buy parts for my own robot, so Iāve gone back and updated everything to a simple robot configuration that is interesting to me, and Iām having a bit of trouble with Gazebo.
My robot is a little flashlight holding bot, with an XY prismatic gantry and an AB revolute flashlight pointing head. Itās going to be mounted above my workbench and point a light at things Iām working on.
I want the base XY gantry to just be stuck floating in Gazebo about 1 m off the ground, and completely insensitive to inertial effects, like itās been fastened to my workbench overhang.
Does anyone know how to do that? I havenāt found a good way to mark a URDF element as kinematic instead of dynamic for Gazebo.
My URDF is below, with placeholder inertial info for each link just to get it working in Gazebo:
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro" >
<xacro:include filename="inertial_macros.xacro"/>
<!-- Materials -->
<material name="white">
<color rgba="1 1 1 1"/>
</material>
<material name="orange">
<color rgba="1 0.3 0.1 1"/>
</material>
<material name="blue">
<color rgba="0.2 0.2 1 1"/>
</material>
<material name="black">
<color rgba="0 0 0 1"/>
</material>
<!-- Base Link -->
<link name="base_link">
</link>
<!-- Chassis Link -->
<joint name="chassis_joint" type="fixed">
<parent link="base_link" />
<child link="chassis"/>
<origin xyz="0 0 1" />
</joint>
<link name="chassis">
<visual>
<!-- Rear X Rail -->
<origin xyz="0 -0.25 0" />
<geometry>
<box size="1 0.05 0.05"/>
</geometry>
<material name="white"/>
</visual>
<visual>
<!-- Front X Rail -->
<origin xyz="0 0.25 0" />
<geometry>
<box size="1 0.05 0.05"/>
</geometry>
<material name="white"/>
</visual>
<visual>
<!-- Left Y Support -->
<origin xyz="-0.5 0 0" />
<geometry>
<box size="0.05 0.5 0.05"/>
</geometry>
<material name="white"/>
</visual>
<visual>
<!-- Right Y Support -->
<origin xyz="0.5 0 0" />
<geometry>
<box size="0.05 0.5 0.05"/>
</geometry>
<material name="white"/>
</visual>
<collision>
<!-- Rear X Rail -->
<origin xyz="0 -0.25 0" />
<geometry>
<box size="1 0.05 0.05"/>
</geometry>
</collision>
<collision>
<!-- Front X Rail -->
<origin xyz="0 0.25 0" />
<geometry>
<box size="1 0.05 0.05"/>
</geometry>
</collision>
<collision>
<!-- Left Y Support -->
<origin xyz="-0.5 0 0" />
<geometry>
<box size="0.05 0.5 0.05"/>
</geometry>
</collision>
<collision>
<!-- Right Y Support -->
<origin xyz="0.5 0 0" />
<geometry>
<box size="0.05 0.5 0.05"/>
</geometry>
</collision>
<xacro:inertial_box mass="0.5" x="0.3" y="0.3" z="0.15">
<origin xyz="0.15 0 0.075" rpy="0 0 0"/>
</xacro:inertial_box>
</link>
<!-- <gazebo reference="chassis">
<material>Gazebo/Grey</material>
<selfCollide>false</selfCollide>
</gazebo> -->
<!-- X Axis Link -->
<joint name="x_axis_joint" type="prismatic">
<parent link="chassis" />
<child link="x_axis"/>
<origin xyz="-0.45 0 0" />
<axis xyz="1 0 0"/>
<limit lower="0" upper="0.9" effort="20" velocity="0.05"/>
</joint>
<link name="x_axis">
<visual>
<origin xyz="0 0 0"/>
<geometry>
<box size="0.025 0.5 0.025"/>
</geometry>
<material name="black"/>
</visual>
<collision>
<origin xyz="0 0 0"/>
<geometry>
<box size="0.025 0.5 0.025"/>
</geometry>
</collision>
<xacro:inertial_box mass="0.5" x="0.3" y="0.3" z="0.15">
<origin xyz="0.15 0 0.075" rpy="0 0 0"/>
</xacro:inertial_box>
</link>
<!-- Y Axis Link -->
<joint name="y_axis_joint" type="prismatic">
<parent link="x_axis" />
<child link="y_axis"/>
<origin xyz="0 -0.175 -0.025" />
<axis xyz="0 1 0"/>
<limit lower="0" upper="0.35" effort="20" velocity="0.05"/>
</joint>
<link name="y_axis">
<visual>
<origin xyz="0 0 0"/>
<geometry>
<box size="0.1 0.1 0.025"/>
</geometry>
<material name="orange"/>
</visual>
<collision>
<origin xyz="0 0 0"/>
<geometry>
<box size="0.1 0.1 0.025"/>
</geometry>
</collision>
<xacro:inertial_box mass="0.5" x="0.3" y="0.3" z="0.15">
<origin xyz="0.15 0 0.075" rpy="0 0 0"/>
</xacro:inertial_box>
</link>
<!-- A Axis Link -->
<joint name="a_axis_joint" type="revolute">
<parent link="y_axis" />
<child link="a_axis"/>
<origin xyz="0 0 0" />
<axis xyz="0 0 1"/>
<limit lower="-3.14" upper="3.14" effort="20" velocity="12"/>
</joint>
<link name="a_axis">
<visual>
<origin xyz="0 0 0"/>
<geometry>
<sphere radius="0.05"/>
</geometry>
<material name="orange"/>
</visual>
<collision>
<origin xyz="0 0 0"/>
<geometry>
<sphere radius="0.05"/>
</geometry>
</collision>
<xacro:inertial_box mass="0.5" x="0.3" y="0.3" z="0.15">
<origin xyz="0.15 0 0.075" rpy="0 0 0"/>
</xacro:inertial_box>
</link>
<!-- B Axis Link -->
<joint name="b_axis_joint" type="revolute">
<parent link="a_axis" />
<child link="b_axis"/>
<origin rpy="-1.0 0 0 " xyz="0 0 0" />
<axis xyz="1 0 0"/>
<limit lower="0" upper="2.0" effort="20" velocity="12"/>
</joint>
<link name="b_axis">
<visual>
<origin xyz="0 0 -.05"/>
<geometry>
<box size="0.025 0.025 0.015"/>
</geometry>
<material name="orange"/>
</visual>
<collision>
<origin xyz="0 0 -.05"/>
<geometry>
<box size="0.025 0.025 0.015"/>
</geometry>
</collision>
<xacro:inertial_box mass="0.5" x="0.3" y="0.3" z="0.15">
<origin xyz="0.15 0 0.075" rpy="0 0 0"/>
</xacro:inertial_box>
</link>
</robot>
I solved my problem, but wanted to leave this here in case anyone else runs into it.
In order to stick a link to some place in the Gazebo world, add a fixed joint to a link named world
.
I attached mine to my base_link
, with a Z offset of 1 m:
<!-- World Fix Link -->
<link name="world">
</link>
<joint name="weld" type="fixed">
<parent link="world" />
<child link="base_link" />
<origin xyz="0 0 1" />
</joint>
I have problems, to run the robot on gazebo harmonic (on ros2 Jazzy) . When Iāll do the command: āros2 run articubot_one spawn_entity.py -topic robot_description -entity bot_nameā the error is: āNo executable foundā.
I have followed the step of this tutorial, but it still doesnāt work.
any help?
Gazebo was updated and the packages of ros were also updated from jazzy ros , follow up the update video from articulated robotics to understand the change.
I found the issue was to do with new release versions. the commands are different to when josh first made the videos
https://gazebosim.org/docs/latest/ros2_spawn_model/
I am struggling through this myself and have had to revamp the launch files a bit.
I can get gazebo to run now but cant get my model to spawn