Giter Site home page Giter Site logo

agv-iit-kgp / freezing-batman Goto Github PK

View Code? Open in Web Editor NEW
14.0 14.0 27.0 31.04 MB

AGV

License: GNU General Public License v3.0

C++ 55.44% C 29.18% Python 3.98% Common Lisp 0.05% Arduino 3.26% Shell 0.02% CMake 6.37% Makefile 0.27% NewLisp 1.43%

freezing-batman's People

Contributors

abinashmeher999 avatar aditnryn avatar aranyadan avatar arnaghosh avatar dragonfly91 avatar hargup avatar krishna95 avatar kumarkrishna avatar nightfury37 avatar rohansur avatar shivamvats avatar yvshri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

freezing-batman's Issues

Refactoring the local_planner pkg

  1. Setup and use NetBeans. Apply indentation (Alt+Shift+F) on all .cpp and .hpp files.
  2. Separate run-time debugging. Create a ${PROJECT_NAME}_debugger node which subscribes to local_planner/path and fusion/fusion_map and displays the image.
  3. Use rosparam to shift all the parameters outside of the build flow and into the launch file.
  4. Explore using gdb with launch file to enable runtime debugging.
  5. Organize debugging print statements so that they display their location while printing.

Implement a backup planner.

We have thought of a fast backup planner to be used in case our current planner turns out to be too slow. That planner will work by generating a lot of seeds and choosing one of them by evaluating a cost function for each of them. @narayanaditya95 and @dragonfly91 should write about it in more details.

Allow training of grass removal from multiple images.

We have a pretty clean code to generate and train the grass removal from image. The training data is saved in file Samples.model. When we run the sample generator again, the Samples.model file is replaced by a new file. Modify the code to append new training data to existing model file.

Automate the calibration of LIDAR and camera data.

We can automate the calibration of LIDAR and camera data. Calibration should include:

  • calculate the matrix for the inverse perspective transformation
  • check if the scale of the LIDAR and camera outputs the same.
  • check if the camera and LIDAR finds the obstacle at the same position.

Print a checkerboard on a flex sheet of know dimensions. The flex sheet will should have markers to place obstacles(cones) at fixed positions. Then write a code to do the automated calibration.

Nomenclature

We need to give names to topics. This has to be done offline by you and discussed once in a meeting.

Units

Need to convert all variables to MKS.

Passed arguments getting set to 0

This bug occurs at least twice in the Clothoid code. I'm unable to find anything about it anywhere online! Consider the following method in our code:

Clothoid::drawPath(...) {
    State a;
    a.x = ...
    a.y = ...
    State center;
    center.x = ...
    center.y = ...
    # at this point, both the vars a and center have
    # meaningful data in them
    double r = center.distance(a);
    # when this method is called, inside it, the value 
    # of a.x, a.y are zero (for no reason -> BUG)
    # thus, the output, r is coming out as wrong.

This kind of bug is also visible in another place - getControls. The args to this function are getting zeroed out. I'm working on workarounds for these bugs, and would push as soon as I get the code working.

Please check them and find a solution!

Create navigator nodes.

We need to create navigator nodes which will publish targets for strategy planner to chose from. We will need four navigator nodes.

  • Way Point navigator: Give target according to GPS waypoint
  • Lane Navigator: Give target to follow the lanes
  • Nose Navigator: Give target to for follow nose.
  • Dummy Navigator: Give a target such that the bot always tries to go straight.

Separate Debuggers

Currently the debug code in planner, lane etc are in main loop. This causes performance overloads and results in slow down of the respective modules. Rather, the data to be displayed should be published by the nodes via diagnostic messages which are picked up by separate debugger nodes (one for each module) which would then display the data.

Multiple model files in lane detection.

Currently we are using only one model file Samples.model for machine learning based grass removal. Allow the creation of multiple model files in sample generator. Pass the name of the model file as flag. Then add another option in laneDetectorNode to choose the model file passed as a flag. The default model file shall be Samples.model

strategy_planner

  • Study the IGVC arena
  • Develop individual strategies; lane following; taking from target from gps.
  • Smart switching between strategies.

Increase Camera FPS

See if the Logitech camera's FPS can be increased by decreasing its image resolution via its GUI on Windows.

Dynamic Parameter adjustment in Obstacle Removal

Currently we can adjust the parameters of the Obstacle removal code by the help of track bar. But to use them we have to manually change the values in the code. Write these values to a file while adjusting them from the trackbar in debug mode and load them while running the code normally.

Implement SLAM

Currently we don't have any localization or Mapping modules that greatly restricts the abilities of our planning module. Implementing SLAM(simultaneous Localization and Mapping) will help us implement D* algorithm, plus it will give our bot better ability to maneuver difficult situations in IGVC arena.

Sensor Test

  1. Refactor sensor pkgs. Each of them should have a module.launch. Include these launch files in eklavya3_sensors.launch under eklavya3 application.
  2. Test all sensor nodes if they are working (logitech_camera, hokuyo_node, vn_ins, sparkfun_ahrs)
  3. VN GPS/INS
  4. Indoor Lidar Node
  5. Write script to give auto perms

Remove MRPT dependency from position_from_target

We have a position_from_target package in environment/interpretation. It takes That package takes the current gps position of the bot, the gps position of the target and gives the target pose. The package is dependent on MRTP library for the conversion of GPS points to 3D points in space. I feel is it worth the effort to remove the MRPT dependency. See the code of the conversion in MRPT from here https://github.com/jlblancoc/mrpt/blob/master/libs/topography/src/conversions.cpp and port it to our package. The conversion code is pretty straight forward.

Refactor lane_detector pkg

  • Separate debugger node to display the final image. All the intermediate images should be displayed only under debug flag.
  • Remove individual FPS checks. Keep only one for the whole pipeline and keep it under debug flag
  • Move common params to eklavya_launchers launch files
  • Express the constants in inversePerspectiveTransform.cpp in terms of map_size instead of hard coding them
  • Use hierarchy to order window names in the interior files (low priority ~ post IGVC)
  • Move all important remaining params outside to the module.launch
  • Rename old lane_detector pkg to color_based_lane_detector. Rename this one to lane_detector

Update Navigation module

TODO List:

  • Remove dependency from Utils
    -It depends on Utils only because of State message type. I think that we should have a Utils package for things like this which will be common to many modules.
  • Port rest of the code from eklavya_navigation
    -Just like FollowNose there are other strategies which have to be ported from the old package.

roslaunch and rosparam

Create launch files for each module. Move all parameters to the launch file and fetch them during run time using rosparam. Follow this link: http://wiki.ros.org/roscpp_tutorials/Tutorials/Parameters to understand what code to add to fetch params during run time. This link: http://wiki.ros.org/roslaunch/XML/param gives a simple example of how to include the parameters in the launch file. Finally, this link: http://wiki.ros.org/Parameter%20Server gives an idea of what all types of parameters you can give via rosparam.

target_selector node

During IGVC, we need the ability to switch the target selection strategy. Currently, we have two strategies:

  1. Obtain target from lane (end point of the center-line when it cuts the border of the planner's map)
  2. Obtain target from GPS way point
    Before we reach the 1st GPS way point, we will follow the 1st strategy. Once we reach it, switch to the 2nd strategy till we reach the last GPS way point. Once the last one is reached, switch back to the 1st strategy and finish the course. Later on, a 3rd strategy is needed for flags. So, target_selector node is a must. The planner would now be agnostic to the source and nature of the target. It'd just subscribe to the target_selector/target topic.

Lane Detector

Replace the usage of global variables with function parameters.
Shift to opencv's C++ interface.

Code Enhancement

Code rework required in planning/motion_planning/local_planner/src/Clothoid.cpp.

Some TODOs:

  1. Move all comments to ROS_DEBUG. Use the sample format which includes the full path to the file and code section (to be pushed in a while). Keep in mind the verbosity levels while doing so. Also, remember that only ROS_INFO gets dumped to stdout.
  2. Give better variable, method and class names.
  3. Shift variable declarations to reduce scope dependencies as much as possible. Remove unused variables.
  4. Always format (Alt+Shift+F in Netbeans). Keep in mind to remove the not-so-good-looking empty lines in the code. For code assistance in netbeans, pm me or Tanmay.
  5. All parameter initialization should happen in the constructor
  6. No display code should be mingled with the main code. Put them in a separate tester class outside, if required.
  7. Try to break the code into methods wherever you can. The philosophy is to fit the whole of a method's code in the IDE window. Don't create too many methods, though!
  8. Handle exceptions wherever you can. Vector accesses can be guarded using the 'at' method. Divide by zero can be catched using a try-catch. Code should never give a seg-fault.
  9. Try to minimize the number of assignment statements, as most of them are likely to be redundant.
  10. Move the fresnel snippets into a separate singleton class.
  11. Never compare equality of floats, always go for inequality with tolerance
  12. It is understood that a custom class is required, generally. In that case, give a better name to it (than State). In this case, State could have been realized with Pose2D from ROS. This can be converted to our custom class for 2D Pose when we migrate from ROS to our own API.
  13. Respect the protection levels of the elements in the class. Usually, all the vars should be public and there should be access methods for each variable - if they at all are required. Methods need to be public only when they are necessarily accessed by a 3rd party.
  14. All the code should be in the cpp and the class structure and global vars in the hpp. Please respect this.

Behavior of actualAtan

The if-else block inside the if block of the outermost if-else block has redundant code: it always adds a PI to theta. Please check and fix the bug.

Implement a color filter based backup lane detector.

@shivamvats
You don't need to write new code. We already have a color filter based lane detector code which we used last year. The code is present in laneDetector package. Take it from there and fit it in our current laneDetectorTest package. Add a flag maybe -b to allow us to use it. You will have to make a few changes in the code. The old code is in IPLImage format convert it into cv::Mat. This work shouldn't take much time. Do it by tomorrow afternoon, that will be 3PM 11th May 2014.

Document the sensors modules.

We have a lot of sensors and have a lot of corresponding sensors modules. That includes

  • Camera
  • Hokuyo LIDAR
  • Sparkfun IMU
  • VertorNav INS
  • encoder.

They might have pretty different usability options and different input and output interface. We need to document them for easier use in future.

The document can be of form

Hokuyo LIDAR
============

Description of Sensor 
------------------


Usage:
`rosrun <package_name> <executable> <option>`

Description of Options
---------------------------

Publisher Data Type
-------------------------

Other Relevant Information
--------------------------------

DT Planner Crashes

Planner crashes with a glibc error after a few seconds under DT mode. The normal mode is working fine (ran okay for 10 minutes).
Try using gdb to track down the memory corruption. Also sanity-check the mapping methods - make sure you are not putting the start / goal very close to some obstacle. Since it works w/o DT but not with DT, the error may be caused by the extra code. But, this is not necessarily the case.

@satyapr see if you can help.

Also, @yvshri and I would be working on refactoring the local_planner and get it deploy-ready in the meanwhile.

Bizarre Paths

The following input to the Trajectory class gives bizarre paths.
pose: (287.446466, 129.647887, 0.176044)
target: (500, 521.333333, 1.570000)

Please investigate this further.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.