Skip to content

Commit

Permalink
fix rotations
Browse files Browse the repository at this point in the history
  • Loading branch information
qhdwight committed Oct 3, 2023
1 parent 6bc1930 commit 78cd144
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 32 deletions.
34 changes: 17 additions & 17 deletions starter_project/autonomy/launch/starter_project.launch
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
<launch>
<arg name="gui" default="false" />
<param name="robot_description" command="xacro $(find mrover)/urdf/rover/rover.urdf.xacro" />
<arg name="rvizconfig" default="$(find mrover)/starter_project/autonomy/config/starter_project.rviz" />
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true" />
<arg name="gui" default="false"/>
<param name="robot_description" command="xacro $(find mrover)/urdf/rover/rover.urdf.xacro"/>
<arg name="rvizconfig" default="$(find mrover)/starter_project/autonomy/config/starter_project.rviz"/>
<node name="rviz" pkg="rviz" type="rviz" args="-d $(arg rvizconfig)" required="true"/>

<node if="$(arg gui)" name="joint_state_publisher" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui" />
<node unless="$(arg gui)" name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
<node if="$(arg gui)" name="joint_state_publisher" pkg="joint_state_publisher_gui" type="joint_state_publisher_gui"/>
<node unless="$(arg gui)" name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher"/>
<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"/>

<include file="$(find gazebo_ros)/launch/empty_world.launch">
<env name="GAZEBO_MODEL_PATH" value="$(find mrover)/config/gazebo/env_description:$(find mrover)/starter_project/autonomy/config" />
<arg name="world_name" value="$(find mrover)/starter_project/autonomy/config/starter_project.world" />
<arg name="paused" value="false" />
<arg name="use_sim_time" value="true" />
<arg name="gui" value="true" />
<arg name="headless" value="false" />
<arg name="debug" value="false" />
<arg name="verbose" default="false" />
<arg name="gui_required" value="true" />
<env name="GAZEBO_MODEL_PATH" value="$(find mrover)/config/gazebo/env_description:$(find mrover)/starter_project/autonomy/config"/>
<arg name="world_name" value="$(find mrover)/starter_project/autonomy/config/starter_project.world"/>
<arg name="paused" value="false"/>
<arg name="use_sim_time" value="true"/>
<arg name="gui" value="true"/>
<arg name="headless" value="false"/>
<arg name="debug" value="false"/>
<arg name="verbose" default="false"/>
<arg name="gui_required" value="true"/>
</include>

<node name="spawn_model" pkg="gazebo_ros" type="spawn_model" output="screen" args="
-urdf -param robot_description
-model rover" />
-model rover"/>

<!--
==========
Expand Down
4 changes: 2 additions & 2 deletions urdf/meshes/rover.wheel.dae
Git LFS file not shown
18 changes: 9 additions & 9 deletions urdf/rover/rover.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@
</collision>
</link>

<xacro:macro name="wheel" params="side reflect rotate">
<xacro:macro name="wheel" params="side reflect">
<link name="front_${side}_wheel_link">
<xacro:sphere_inertia m="${wheel_mass}" r="${wheel_radius}"/>
<visual>
<origin rpy="0 0 ${rotate * PI}" xyz="0.0 0.0 0.0"/>
<origin rpy="0 ${min(0, reflect) * PI} 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://mrover/urdf/meshes/rover.wheel.dae"/>
</geometry>
Expand All @@ -70,7 +70,7 @@
<link name="center_${side}_wheel_link">
<xacro:cylinder_inertia m="${wheel_mass}" r="${wheel_radius}" h="${wheel_width}"/>
<visual>
<origin rpy="0 0 ${rotate * PI}" xyz="0.0 0.0 0.0"/>
<origin rpy="0 ${min(0, reflect) * PI} 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://mrover/urdf/meshes/rover.wheel.dae"/>
</geometry>
Expand All @@ -86,7 +86,7 @@
<xacro:sphere_inertia m="${wheel_mass}" r="${wheel_radius}"/>

<visual>
<origin rpy="0 0 ${rotate * PI}" xyz="0.0 0.0 0.0"/>
<origin rpy="0 ${min(0, reflect) * PI} 0" xyz="0 0 0"/>
<geometry>
<mesh filename="package://mrover/urdf/meshes/rover.wheel.dae"/>
</geometry>
Expand All @@ -101,21 +101,21 @@
<joint name="front_${side}_wheel_joint" type="continuous">
<parent link="chassis_link"/>
<child link="front_${side}_wheel_link"/>
<origin xyz="0.435 ${reflect * (base_width/2 + 0.06)} -0.373" rpy="0 0 0"/>
<origin xyz="0.42 ${reflect * (base_width/2 + 0.06)} -0.373" rpy="${-PI/2} 0 0"/>
<axis xyz="0 0 1"/>
</joint>

<joint name="center_${side}_wheel_joint" type="continuous">
<parent link="chassis_link"/>
<child link="center_${side}_wheel_link"/>
<origin xyz="0 ${reflect * (base_width/2 + 0.06)} -0.373" rpy="0 0 0"/>
<origin xyz="0 ${reflect * (base_width/2 + 0.06)} -0.373" rpy="${-PI/2} 0 0"/>
<axis xyz="0 0 1"/>
</joint>

<joint name="back_${side}_wheel_joint" type="continuous">
<parent link="chassis_link"/>
<child link="back_${side}_wheel_link"/>
<origin xyz="-0.435 ${reflect * (base_width/2 + 0.06)} -0.373" rpy="0 0 0"/>
<origin xyz="-0.42 ${reflect * (base_width/2 + 0.06)} -0.373" rpy="${-PI/2} 0 0"/>
<axis xyz="0 0 1"/>
</joint>
</xacro:macro>
Expand Down Expand Up @@ -189,6 +189,6 @@
</link>

<xacro:include filename="$(find mrover)/urdf/rover/rover_gazebo_plugins.urdf.xacro"/>
<xacro:wheel side="left" reflect="1" rotate="1"/>
<xacro:wheel side="right" reflect="-1" rotate="0"/>
<xacro:wheel side="left" reflect="1"/>
<xacro:wheel side="right" reflect="-1"/>
</robot>
4 changes: 2 additions & 2 deletions urdf/staging/rover.blend
Git LFS file not shown
4 changes: 2 additions & 2 deletions urdf/staging/rover.dae.blend
Git LFS file not shown

0 comments on commit 78cd144

Please sign in to comment.