Skip to content
Branch: master
Find file History
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
gui
interfaces
resources
MyAlgorithm.py
README.md
generateGUI
resources_rc.py
stop.py
stop_conf.yml

README.md

Car Junction

The goal of this practice is to implement the logic of a navigation algorithm for an automated vehicle. The vehicle must Stop at the T joint, where there is a stop sign, wait until there are no cars and pass once the road is clear.

How to execute?

To launch the example, follow the steps below:

  1. Source the gazebo setups:
$ source /opt/jderobot/share/jderobot/gazebo/gazebo-setup.sh
$ source /opt/jderobot/share/jderobot/gazebo/gazebo-assets-setup.sh
  1. Run Gazebo simulator:
$ roslaunch /opt/jderobot/share/jderobot/gazebo/launch/car_1_junction.launch
  1. Running the practice and the user interface:
$ python2 ./stop.py stop_conf.yml

To simplify the closure of the environment, just close the Stop Component window(s). Ctrl + C will give problems.

How to do the practice

To carry out the practice, you must edit the MyAlgorithm.py file and insert the control logic into it.

Where to insert the code?

MyAlgorithm.py

def execute(self):
        
    # Add your code here
    print "Running"
    # Getting the images
    input_image = self.cameraC.getImage().data      

API

  • self.cameraC.getImage().data - to get image from center camera

  • self.cameraL.getImage().data - to get image from left camera

  • self.cameraR.getImage().data - to get image from right camera

  • self.pose3d.getPose3d().x - to obtain the position of the robot

  • self.pose3d.getPose3d().y - to obtain the position of the robot

  • self.pose3d.getPose3d().yaw - to obtain the position of the robot

  • self.motors.sendW() - to set the angular velocity

  • self.motors.sendV() - to set the linear velocity

Demonstrative video

Car Junction Video Demo

You can’t perform that action at this time.