Skip to content

praingeard/research-track-ros

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 

Repository files navigation

research-track-ros

This code implements a control node for a robot simulation. The speed of the robot can be increased or reduced using services and user input. You can also reset the robot's position.

use

Copy the 2 packages in your ros workspace src folder. Compile with catkin_make. Run using the command roslaunch robot_control robot_launch.xml To change speed you can call the /reduce_speed and /increase_speed empty services. You can also input 1 to increase speed, 2 to reduce it and 3 to reset the robot's position.

Nodes

angle_filter

This node takes a range as parameters and returns the laserscan /base_scan filtered on this range on a chosen topic.

Subscribed topics

  • /base_scan robot laserscan.

Published topics

  • /scan_topic filtered laserscan.

Parameters

  • min_angle(double) minimum angle of the chosen range.
  • max_angle(double) maximum angle of the chosen range.
  • scan_topic(string) topic name for the published scan.

control_node

This node publishes the desired twist of the robot on the /cmd_vel topic. This node also implements the /increase_speed and /reduce_speed services.

Subscribed topics

  • /right_scan robot right laserscan.
  • /left_scan robot left laserscan.
  • /front_right_scan robot front right laserscan.
  • /front_left_scan robot front left laserscan.
  • /current_speed current linear speed.

Published topics

  • /cmd_vel desired velocities.

Services

  • /increase_speed(Empty) increase speed by 20%.
  • /reduce_speed(Empty) reduce speed by 20%.

Algorithm

The node gets the difference in minimum distance between the front left and front right scans. Then it turns the robot away from the wall, with the current velocity as linear speed. If the robot is too close to the front wall then the node gets the difference between right and left distances, slows down the robot and turns away from the closest wall. The different services add or reduce the current speed by 20%.

ui_node

This node implements the /increase_speed, /reduce_speed and /reset_positions service clients.

Algorithm

The node waits for a user input (between 1 and 3) and calls the corresponding service (add or reduce speed and reset).

flowchart of the code

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors