IE-482-582 / fall2021

5 stars 4 forks source link

Sonoma Raceway #14

Open cmurray3 opened 3 years ago

cmurray3 commented 3 years ago

We'll discuss this code in the Nov. 2, 2021 class...


Creating a launch file for our racetrack:

1. Copy the following launch code:

<launch>
  <arg name="model" default="waffle_pi" doc="model type [burger, waffle, waffle_pi]"/>
  <arg name="x_pos" default="0.0"/>
  <arg name="y_pos" default="0.0"/>
  <arg name="z_pos" default="40.0"/>

  <include file="$(find gazebo_ros)/launch/empty_world.launch">
    <arg name="world_name" value="$(find turtlebot3_gazebo)/worlds/sonoma_raceway.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"/>
  </include>

  <param name="robot_description" command="$(find xacro)/xacro --inorder $(find turtlebot3_description)/urdf/turtlebot3_$(arg model).urdf.xacro" />

  <node pkg="gazebo_ros" type="spawn_model" name="spawn_urdf"  args="-urdf -model turtlebot3_$(arg model) -x $(arg x_pos) -y $(arg y_pos) -z $(arg z_pos) -param robot_description" />
</launch>

2. Save to a .launch file:

pico  ~/catkin_ws/src/turtlebot3_simulations/turtlebot3_gazebo/launch/sonoma_raceway.launch

Creating a world file for our racetrack:

3. Copy the following code:

<?xml version="1.0" ?>
<sdf version="1.6">
  <world name="default">
    <!-- A global light source -->
    <scene>
      <ambient>0.95 0.95 0.95 1</ambient>
      <background>0.3 0.3 0.3 1</background>
      <shadows>true</shadows>
    </scene>
    <include>
      <uri>model://sun</uri>
    </include>
    <include>
      <uri>model://sonoma_raceway</uri>
      <pose>-295 150 -7 0 0 0</pose>
    </include>
    <spherical_coordinates>
      <surface_model>EARTH_WGS84</surface_model>
      <latitude_deg>38.161479</latitude_deg>
      <longitude_deg>-122.454630</longitude_deg>
      <elevation>488.0</elevation>
    </spherical_coordinates>
    <physics name='default_physics' default='0' type='ode'>
      <gravity>0 0 -9.8066</gravity>
      <ode>
        <solver>
          <type>quick</type>
          <iters>10</iters>
          <sor>1.3</sor>
          <use_dynamic_moi_rescaling>0</use_dynamic_moi_rescaling>
        </solver>
        <constraints>
          <cfm>0</cfm>
          <erp>0.2</erp>
          <contact_max_correcting_vel>100</contact_max_correcting_vel>
          <contact_surface_layer>0.001</contact_surface_layer>
        </constraints>
      </ode>
      <max_step_size>0.004</max_step_size>
      <real_time_factor>1</real_time_factor>
      <real_time_update_rate>250</real_time_update_rate>
      <magnetic_field>6.0e-6 2.3e-5 -4.2e-5</magnetic_field>
    </physics>
  </world>
</sdf>

4. Save to a .world file:

pico  ~/catkin_ws/src/turtlebot3_simulations/turtlebot3_gazebo/worlds/sonoma_raceway.world

Launching our turtlebot on the racetrack

roslaunch turtlebot3_gazebo sonoma_raceway.launch
krysc0 commented 3 years ago

https://github.com/warthog-cpr/warthog_simulator/tree/melodic-devel/warthog_gazebo

Danealor commented 3 years ago

I found what seems to be a pretty exhaustive list of ROS robots at robots.ros.org. It includes a short list of "Outdoor" robots here, one of which is a golf-cart-looking robot called the RBCAR.

Seeing the the RBCAR had a "has_camera" option in its launch file, I went through the instructions here to install it to my workspace.

A few notes on the installation:

Even then I still get errors in dpkg and launching, I couldn't find the camera topic, and the bot was very jittery on its suspensions. Maybe you'll find a way to fix those problems.

On a different note, it does seem like the simulated Prius has a camera.

krysc0 commented 3 years ago

https://clearpathrobotics.com/jackal-small-unmanned-ground-vehicle/ https://clearpathrobotics.com/husky-unmanned-ground-vehicle-robot/ https://clearpathrobotics.com/blog/2021/08/ros-noetic-now-available-on-husky-ugv/