Skip to content

Commit

Permalink
Task 2D commit
Browse files Browse the repository at this point in the history
  • Loading branch information
smitkesaria committed Nov 27, 2022
1 parent 6d107ae commit 3fcb6b1
Show file tree
Hide file tree
Showing 3 changed files with 262 additions and 0 deletions.
31 changes: 31 additions & 0 deletions sentinel_drone/launch/task_2d.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<launch>
<include file="$(find rotors_gazebo)/launch/edrone_with_edrone_msg_arena_2d.launch">
</include>

<arg name="name" default="whycon"/>
<arg name="targets" default="1"/>
<!-- DO NOT CHANGE THE FOLLOWING TWO VALUES -->
<arg name="outer_diameter" default=".55"/>
<arg name="inner_diameter" default=".20"/>



<node name="whycon" type="whycon" pkg="whycon" output="screen">
<param name="targets" value="$(arg targets)"/>
<param name="name" value="$(arg name)"/>
<param name="outer_diameter" value="$(arg outer_diameter)"/>
<param name="inner_diameter" value="$(arg inner_diameter)"/>
<remap from="/camera/camera_info" to="/gazebo/overhead_cam/camera_info"/>
<remap from="/camera/image_rect_color" to="/gazebo/overhead_cam/image_rect_color"/>
</node>


<node ns = "whycon_display" name="image_view" type="image_view" pkg="image_view" output="screen">
<remap from="image" to="/whycon/image_out"/>
</node>
<node ns = "drone_display" name="image_view" type="image_view" pkg="image_view" output="screen">
<remap from="image" to="/edrone/camera_rgb/image_raw"/>
</node>

</launch>

39 changes: 39 additions & 0 deletions task_1/rotors_gazebo/launch/edrone_with_edrone_msg_arena_2d.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
<launch>
<arg name="mav_name" default="edrone"/>
<arg name="world_name" default="basic"/>
<arg name="enable_logging" default="false" />
<arg name="enable_ground_truth" default="true" />
<arg name="log_file" default="$(arg mav_name)" />
<arg name="Yaw" default="1.57079632679"/>


<env name="GAZEBO_MODEL_PATH" value="${GAZEBO_MODEL_PATH}:$(find rotors_gazebo)/models"/>
<env name="GAZEBO_RESOURCE_PATH" value="${GAZEBO_RESOURCE_PATH}:$(find rotors_gazebo)/models"/>
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(find rotors_gazebo)/worlds/basic_edrone_2d.world" />
<!-- <arg name="debug" value="true"/> -->
<arg name="paused" value="false"/>
<!-- <arg name="gui" value="false"/> -->
</include>

<group ns="$(arg mav_name)">
<include file="$(find rotors_gazebo)/launch/spawn_mav.launch">
<arg name="mav_name" value="$(arg mav_name)" />
<arg name="model" value="$(find rotors_description)/urdf/mav_generic_odometry_sensor.gazebo" />
<arg name="enable_logging" value="$(arg enable_logging)" />
<arg name="enable_ground_truth" value="$(arg enable_ground_truth)" />
<arg name="log_file" value="$(arg log_file)"/>
<arg name="Yaw" value="$(arg Yaw)"/>
</include>
<node name="rotors_edrone_interface" pkg="rotors_edrone_interface" type="rotors_edrone_interface" />
<node name="roll_pitch_yawrate_thrust_controller_node" pkg="rotors_control" type="roll_pitch_yawrate_thrust_controller_node" output="screen">
<rosparam
command="load" file="$(find rotors_gazebo)/resource/roll_pitch_yawrate_thrust_controller_$(arg mav_name).yaml" />
<rosparam command="load" file="$(find rotors_gazebo)/resource/$(arg mav_name).yaml" />
<remap from="odometry" to="odometry_sensor1/odometry" />
</node>

<node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher" />
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher" />
</group>
</launch>
192 changes: 192 additions & 0 deletions task_1/rotors_gazebo/worlds/basic_edrone_2d.world
Original file line number Diff line number Diff line change
@@ -0,0 +1,192 @@
<sdf version="1.4">
<world name="default">
<scene>
<shadows>false</shadows>
<grid>false</grid>
<origin_visual>false</origin_visual>

<sky>
<clouds>
<speed>4</speed>
</clouds>
</sky>
</scene>
<include>
<uri>model://sun</uri>
</include>

<!-- <include>
<uri>model://ground_plane</uri>
</include> -->

<model name='ground_plane'>
<static>1</static>
<link name='link'>
<collision name='collision'>
<geometry>
<plane>
<normal>0 0 1</normal>
<size>100 100</size>
</plane>
</geometry>
<surface>
<friction>
<ode>
<mu>100</mu>
<mu2>50</mu2>
</ode>
</friction>
<bounce/>
<contact>
<ode/>
</contact>
</surface>
<max_contacts>10</max_contacts>
</collision>
<visual name='visual'>
<cast_shadows>0</cast_shadows>
<geometry>
<plane>
<normal>0 0 1</normal>
<size>100 100</size>
</plane>
</geometry>
<material>
<script>
<uri>file://media/materials/scripts/gazebo.material</uri>
<name>Gazebo/Grey</name>
</script>
</material>
</visual>
<velocity_decay>
<linear>0</linear>
<angular>0</angular>
</velocity_decay>
<self_collide>0</self_collide>
<kinematic>0</kinematic>
<gravity>1</gravity>
</link>
<link name='camera_link'>
<pose>0 0 4.8768 0 1.57 1.57</pose> <!-- camera placed at a heigth of 16 feet-->
<inertial>
<mass>0.1</mass>
<inertia>
<ixx>1</ixx>
<ixy>0</ixy>
<ixz>0</ixz>
<iyy>1</iyy>
<iyz>0</iyz>
<izz>1</izz>
</inertia>
</inertial>
<collision name='collision'>
<geometry>
<box>
<size>0.001 0.001 0.001</size>
</box>
</geometry>
<max_contacts>10</max_contacts>
<surface>
<bounce/>
<friction>
<ode/>
</friction>
<contact>
<ode/>
</contact>
</surface>
</collision>
<visual name='visual'>
<geometry>
<box>
<size>0.001 0.001 0.001</size>
</box>
</geometry>
</visual>
<sensor type='camera' name='camera'>
<camera name='overhead_cam'>
<horizontal_fov>1.0</horizontal_fov>
<image>
<width>1280</width>
<height>1280</height>
</image>
<clip>
<near>0.1</near>
<far>5</far>
</clip>

</camera>

<plugin name='camera_control' filename='libgazebo_ros_camera.so'>
<alwaysOn>true</alwaysOn>
<updateRate>0</updateRate>
<cameraName>gazebo/overhead_cam</cameraName>
<imageTopicName>image_rect_color</imageTopicName>
<cameraInfoTopicName>camera_info</cameraInfoTopicName>
<frameName>overhead_cam_frame</frameName>
</plugin>
<always_on>1</always_on>
<update_rate>30</update_rate>
<visualize>0</visualize>

</sensor>

<gravity>1</gravity>
</link>
</model>

<include>
<uri>model://arena</uri>
<pose>0 0 0.001 0 0 0</pose>
</include>

<include>
<uri>model://yellow_box</uri>
<name>box_1</name>
<pose>-1.312795 0.767620 0 0 0 0</pose>
</include>

<include>
<uri>model://yellow_box</uri>
<name>box_2</name>
<pose>1.000450 1.000450 0 0 0 0</pose>
</include>

<include>
<uri>model://yellow_box</uri>
<name>box_3</name>
<pose>-0.802892 -1.210398 0 0 0 0</pose>
</include>

<!-- Only one ROS interface plugin is required per world, as any other plugin can connect a Gazebo
topic to a ROS topic (or vise versa). -->
<plugin name="ros_interface_plugin" filename="librotors_gazebo_ros_interface_plugin.so"/>

<spherical_coordinates>
<surface_model>EARTH_WGS84</surface_model>
<latitude_deg>47.3667</latitude_deg>
<longitude_deg>8.5500</longitude_deg>
<elevation>0.0</elevation>
<heading_deg>0</heading_deg>
</spherical_coordinates>
<physics type='ode'>
<ode>
<solver>
<type>quick</type>
<iters>1000</iters>
<sor>1.3</sor>
</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.001</max_step_size>
<real_time_factor>1</real_time_factor>
<real_time_update_rate>1000</real_time_update_rate>
<gravity>0 0 -9.8</gravity>
</physics>
</world>
</sdf>

0 comments on commit 3fcb6b1

Please sign in to comment.