Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wallfollowing improvements #129

Open
wants to merge 91 commits into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 31 commits
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
49f327d
initial commit
Pietus3 Jun 25, 2020
b61c9f6
State before Development Merge
Pietus3 Jul 9, 2020
da9e96b
Merge branch 'development' of https://github.com/arpg-sophisticated/a…
Pietus3 Jul 9, 2020
b731ef7
Merge remote-tracking branch 'origin/wallfollowing-improvements' into…
Pietus3 Jul 9, 2020
a3185cc
State after merge
Pietus3 Jul 9, 2020
f29c76d
add bare cpp implementation of log_stats node
Rothu Jul 15, 2020
a4fb384
add more subscriber and publisher
Rothu Jul 15, 2020
dfbc55b
Merge
Pietus3 Jul 20, 2020
5f5fa98
Erweiterung des Wall Publishings
Pietus3 Jul 20, 2020
ccab881
launch Files erweiter um avoid static code
Pietus3 Jul 20, 2020
ace3c44
added results config file
Jul 20, 2020
ca6b3cc
fix curve entry detection
Rothu Jul 20, 2020
632c873
closes #122 - implemented
Jul 21, 2020
7788abe
closes #122 - implemented
Jul 21, 2020
325a648
Merge branch 'development' into log-stats
jhbruhn Jul 21, 2020
7fe1ea2
Merge branch 'wallfollowing-improvements' into log-stats
jhbruhn Jul 21, 2020
0a7a49f
Update boxing.h
jhbruhn Jul 21, 2020
d1f5f2b
Merge pull request #127 from arpg-sophisticated/log-stats
Jul 22, 2020
3cc77ef
enable analysis tool
jhbruhn Jul 22, 2020
27d7b11
Merge branch 'wallfollowing-improvements' of github.com:arpg-sophisti…
jhbruhn Jul 22, 2020
7fea5a1
update
Jul 22, 2020
ce194bc
Merge branch 'wallfollowing-improvements' of github.com:arpg-sophisti…
Jul 22, 2020
ffcaccf
results today
Jul 22, 2020
dd509af
column headers in latex data file to lowercase
Jul 22, 2020
28c8351
add braking safety margin to dynamic_reconfigure
Rothu Jul 27, 2020
1d67d70
fix braking safety margin to dynamic_reconfigure
Rothu Jul 27, 2020
0ab5b96
set dynamic_friction to 0.6
Rothu Jul 27, 2020
8828e41
adjust wallfollowing.cfg to more stable values
Rothu Jul 27, 2020
090ca87
update 20-07-27
Jul 27, 2020
d19a572
Merge branch 'wallfollowing-improvements' of github.com:arpg-sophisti…
Jul 27, 2020
9369e77
fix convertRpmToSpeed
Rothu Jul 30, 2020
7aa71b4
add physical properties to dynamic reconfigure
Rothu Aug 2, 2020
0a52c7e
improve trajectory before curve entries
Rothu Aug 2, 2020
f795c0c
crop pointcloud for wall detection step
Rothu Aug 4, 2020
69dbf11
imrove steering before curve entries
Rothu Aug 4, 2020
60766e1
Merge branch 'development' of https://github.com/arpg-sophisticated/a…
Pietus3 Aug 5, 2020
9627bf2
add small outlier detection
Aug 5, 2020
587c840
add correction factor for speed
Rothu Aug 10, 2020
41e8032
add dynamic reconfigure to radius porportion factor
Rothu Aug 10, 2020
b2f5ff0
merge
Rothu Aug 10, 2020
a51abbe
add explanation for speed correction factor
Rothu Aug 10, 2020
e37ee7c
add MAX_SENSIBLE_TRACK_WIDTH to avoid extreme outliers
Rothu Aug 10, 2020
c545eae
set wallfollowing parameter to stable default values
Rothu Aug 10, 2020
ed3f64a
add simple obstacle avoidance
Rothu Aug 11, 2020
6421af1
remove duplicates of parameter server getters
Rothu Aug 11, 2020
b311443
set friction to 0.5
Rothu Aug 11, 2020
a948b24
remove unnecessary functions
Rothu Aug 11, 2020
b5a66de
optimize code
Rothu Aug 11, 2020
879ab29
Fixed KoordinatenSystem in WallDetection
Pietus3 Aug 11, 2020
139f630
Added RQT directory
Aug 12, 2020
1d9e012
changed default wf5 launchfile
Aug 12, 2020
4664381
Merge branch 'wallfollowing-improvements' into feature/avoid_static_o…
Aug 12, 2020
fd9c4c5
flip right and left wall
Aug 12, 2020
0096b1e
improve obstacle avoidance
Aug 12, 2020
61e0011
fix on #128 - added offset to avoid extreme values
Aug 14, 2020
16cde04
fix on #128 - added offset to avoid extreme values
Aug 14, 2020
864e07c
Merge branch 'feature/avoid_static_obstacles' into wallfollowing-impr…
Aug 17, 2020
0472539
Paths changed
Aug 17, 2020
7a4d85f
uploaded video as gif
Aug 17, 2020
63f382a
Add 0.9 factor to wallfollowing2 to fix simulation performance
jhbruhn Aug 17, 2020
13ead6c
bMerge branch 'wallfollowing-improvements' of github.com:arpg-sophist…
jhbruhn Aug 17, 2020
615ab69
added
Aug 17, 2020
63b5687
Merge branch 'wallfollowing-improvements' of https://github.com/arpg-…
Aug 17, 2020
2d074aa
Add 3d printed parts
jhbruhn Aug 18, 2020
c562f51
Merge branch 'development' into wallfollowing-improvements
jhbruhn Aug 19, 2020
1c39029
add small outlier detection
Aug 19, 2020
a552496
increase braking
Aug 19, 2020
3f9427a
activate debug message
Aug 19, 2020
7ac98cd
deactivate obstacle avoidance node
Aug 19, 2020
de86b3e
Merge branch 'wallfollowing-improvements' of https://github.com/arpg-…
Aug 19, 2020
65d7093
Launch dynamic physical properties node in reinforcement learning script
jhbruhn Aug 19, 2020
8f85be4
Merge branch 'wallfollowing-improvements' of github.com:arpg-sophisti…
jhbruhn Aug 19, 2020
7a314ed
Add lap timer to q learning
jhbruhn Aug 19, 2020
bf1547f
add sanity check to wf5
Rothu Aug 19, 2020
6e4c1e1
Merge branch 'wallfollowing-improvements' of https://github.com/arpg-…
Rothu Aug 19, 2020
7168e14
Fix formatting
jhbruhn Aug 19, 2020
83c85a6
Merge branch 'wallfollowing-improvements' of github.com:arpg-sophisti…
jhbruhn Aug 19, 2020
21f0dee
added stats-nodes to q_learning-launch file
MaLangenk Aug 19, 2020
b83e388
Merge branch 'wallfollowing-improvements' of https://github.com/arpg-…
MaLangenk Aug 19, 2020
038451d
minor fixes
Aug 19, 2020
ae0357e
Merge branch 'wallfollowing-improvements' of github.com:arpg-sophisti…
Aug 19, 2020
fb659c1
reduce max view distance for outlier detection
Aug 19, 2020
f7605d2
Merge branch 'wallfollowing-improvements' of https://github.com/arpg-…
Aug 19, 2020
a7caa65
removed steering angle, added some log plots, minor fixes
Aug 19, 2020
41b7867
Merge branch 'wallfollowing-improvements' of github.com:arpg-sophisti…
Aug 19, 2020
9d63590
add topic_drive_param to physical launch file
MaLangenk Aug 19, 2020
0610204
Merge branch 'wallfollowing-improvements' of https://github.com/arpg-…
MaLangenk Aug 19, 2020
890089a
minor fixes
Aug 19, 2020
8b2868f
Merge branch 'wallfollowing-improvements' of github.com:arpg-sophisti…
Aug 19, 2020
da7de0d
added results
Aug 23, 2020
7ad74b8
Updated
Aug 23, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added doc/rqt-results.ods
Binary file not shown.
23 changes: 15 additions & 8 deletions ros_ws/launch/car_wallfollowing.launch
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
<!-- wallfollowing start - please enable only one -->
<!-- current implementation -->
<include file="$(find wallfollowing5)/launch/autonomous_driving_physical.launch"/>

<node pkg="car_config" type="dynamic_physical_properties" name="dynamic_physical_properties" respawn="true" output="screen"/>

<!-- former implementation of previous group -->
<!--<include file="$(find wallfollowing2)/launch/autonomous_driving_physical.launch"/>-->
Expand Down Expand Up @@ -102,14 +104,19 @@
</group>

<!-- publishes the approximated maximal possible speed for a certain position on the track -->
<!--<node pkg="simulation_tools" type="speed_info" name="speed_info" respawn="true" output="screen"/>-->
<node pkg="analysis-tools" type="speed_info" name="speed_info" respawn="true" output="screen"/>

<!-- needed for logging telemetry data and provide node for rviz -->
<!-- arguments -->
<!-- 1: log prefix (string), default: none -->
<!-- 2: length for min/max arrays (int), default: 100 -->
<!-- 3: smoothing value of acceleration (int), default: 5 -->
<!-- 4: whether its simulation or not (string: yes|no), default: no -->
<!-- 5: whether write statistics or not (string: yes|no), default: no -->
<!--<node pkg="simulation_tools" type="log_stats.py" name="log_stats" output="screen" args="wallfollowing 100 10 no yes"/>-->
<!-- prefix: log prefix (string), default: none -->
<!-- length: length for min/max arrays (int), default: 100 -->
<!-- smooth: smoothing value of acceleration (int), default: 5 -->
<!-- sim: whether its simulation or not (bool), default: false -->
<!-- write: whether write statistics or not (bool), default: false -->
<node pkg="analysis-tools" type="log_stats" name="log_stats" respawn="true" output="screen">
<param name="prefix" value="wallfollowing" />
<param name="length" value="100" />
<param name="smooth" value="10" />
<param name="sim" value="false" />
<param name="write" value="true" />
</node>
</launch>
21 changes: 14 additions & 7 deletions ros_ws/launch/gazebo.launch
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@

<include file="$(find imu_velocity)/launch/car_imu_velocity.launch" />

<node pkg="car_config" type="dynamic_physical_properties" name="dynamic_physical_properties" respawn="true" output="screen"/>

<node pkg="simulation_tools" type="crash_detector" name="crash_detector" output="screen">
</node>
<node pkg="tf" type="static_transform_publisher" name="depth_rotation" args="0.18 0 0.14 -1.570796327 0 -1.570796327 /base_link /camera 10" />
Expand All @@ -134,13 +136,18 @@
<node pkg="simulation_tools" type="speed_info" name="speed_info" respawn="true" output="screen"/>

<!-- needed for logging telemetry data and provide node for rviz -->
<!-- arguments -->
<!-- 1: log prefix (string), default: none -->
<!-- 2: length for min/max arrays (int), default: 100 -->
<!-- 3: smoothing value of acceleration (int), default: 5 -->
<!-- 4: whether its simulation or not (string: yes|no), default: no -->
<!-- 5: whether write statistics or not (string: yes|no), default: no -->
<node pkg="simulation_tools" type="log_stats.py" name="log_stats" respawn="true" output="screen" args="gazebo 100 10 yes yes"/>
<!-- prefix: log prefix (string), default: none -->
<!-- length: length for min/max arrays (int), default: 100 -->
<!-- smooth: smoothing value of acceleration (int), default: 5 -->
<!-- sim: whether its simulation or not (bool), default: false -->
<!-- write: whether write statistics or not (bool), default: false -->
<node pkg="analysis-tools" type="log_stats" name="log_stats" respawn="true" output="screen">
<param name="prefix" value="gazebo" />
<param name="length" value="100" />
<param name="smooth" value="10" />
<param name="sim" value="true" />
<param name="write" value="true" />
</node>

<group if="$(arg record)">
<node pkg="image_view" type="video_recorder" name="video_record_cam">
Expand Down
59 changes: 59 additions & 0 deletions ros_ws/src/analysis-tools/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
cmake_minimum_required(VERSION 2.8.3)
project(analysis-tools)

## Compile as C++14, supported in ROS Melodic and newer
add_compile_options(-std=c++14)

## Find catkin macros and libraries
find_package(catkin REQUIRED COMPONENTS
roscpp
drive_msgs
geometric_math
std_msgs
gazebo_msgs
car_config
vesc_sim
geometric_math
)


## Errors and Warnings
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wchar-subscripts -Wchkp -Wformat -Wnonnull -Wmain -Wswitch-bool -Winvalid-memory-model -Wunknown-pragmas -Warray-bounds -Wfloat-equal -Wlogical-op -Wpacked ")
# -Wpedantic cant be used because of ROS

###################################
## catkin specific configuration ##
###################################

## Declare things to be passed to dependent projects
catkin_package(
INCLUDE_DIRS include
CATKIN_DEPENDS roscpp drive_msgs std_msgs car_config vesc_sim geometric_math
)


###########
## Build ##
###########

## Specify additional locations of header files
include_directories(
include
${catkin_INCLUDE_DIRS}
)


add_executable(log_stats
src/log_stats.cpp
)

target_link_libraries(log_stats ${catkin_LIBRARIES})
add_dependencies(log_stats ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})

# Declare speed info node executable
add_executable(speed_info
src/speed_info.cpp
src/process_track.cpp
)
target_link_libraries(speed_info ${catkin_LIBRARIES} ${GAZEBO_LIBRARIES})
add_dependencies(speed_info ${${PROJECT_NAME}_EXPORTED_TARGETS} ${catkin_EXPORTED_TARGETS})
10 changes: 10 additions & 0 deletions ros_ws/src/analysis-tools/include/config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#pragma once

namespace Config
{
static const float USABLE_LASER_RANGE = 220;
static const double MAX_STEERING_ANGLE = 40.0f;
static const double RPM_FACTOR = 1299.224f;
static const double LOG_INTERVAL = 0.05f;
static const double HUD_PRECISION = 4U;
} // namespace Config
130 changes: 130 additions & 0 deletions ros_ws/src/analysis-tools/include/log_stats.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
#pragma once

#include "config.h"
#include <ctime>
#include <deque>
#include <drive_msgs/drive_param.h>
#include <drive_msgs/gazebo_state_telemetry.h>
#include <fstream>
#include <iostream>
#include <jsk_rviz_plugins/OverlayText.h>
#include <ros/package.h>
#include <ros/ros.h>
#include <sstream>
#include <std_msgs/ColorRGBA.h>
#include <std_msgs/Float32.h>
#include <std_msgs/Float64.h>
#include <sys/stat.h>

constexpr const char* TOPIC_CONTROLLED_DRIVE_PARAM = "/commands/controlled_drive_param";
constexpr const char* TOPIC_MAX_SPEED = "/speed_info/max_speed";
constexpr const char* TOPIC_GAZEBO_STATE_TELEMETRY = "/gazebo/state_telemetry";

class LogStats
{
private:
ros::NodeHandle m_node_handle;
ros::Subscriber m_controlled_drive_parameters_subscriber;
ros::Subscriber m_max_speed_subscriber;
ros::Subscriber m_gazebo_state_telemetry_subscriber;
ros::Publisher m_hud_speed_publisher;
ros::Publisher m_hud_maxspeed_publisher;
ros::Publisher m_hud_rpm_publisher;
ros::Publisher m_hud_acceleration_publisher;
ros::Publisher m_hud_angle_publisher;
ros::Publisher m_hud_distance_publisher;
ros::Publisher m_hud_clock_publisher;
ros::Publisher m_hud_text_publisher;

// paths and filenames
std::string m_filenamedat;
std::string m_filenamecsv;

// create file handlers
std::ofstream m_filestream_dat;
std::ofstream m_filestream_csv;

// counter for logentry
unsigned int m_logentry;

// current time
ros::Time m_time_start;
ros::Duration m_time_last;
ros::Duration m_time_delta;
ros::Duration m_time_interval;
ros::Duration m_time_current;

// parameters
std::string m_log_prefix;
int m_mean_length;
int m_smooth_count;
bool m_is_simulation;
bool m_write_logfile;

// incoming data
// double m_current_speed;
// double m_current_steering_angle;
// double m_max_speed;
// double m_gazebo_wheel_speed; // ???
// double m_gazebo_car_speed; // ???

// calculated data - speed
double m_speed_current;
double m_speed_last;
double m_speed_delta;
double m_speed_avg;
std::deque<double> m_speed_avgtime;
double m_speed_max;
std::deque<double> m_speed_maxtime;
std::deque<double> m_speed_smooth;

// calculated data - maximum speed from algorithm
double m_maxspeed_value;
double m_maxspeed_current;
double m_maxspeed_last;
double m_maxspeed_delta;
double m_maxspeed_avg;
std::deque<double> m_maxspeed_smooth;

// calculated data - driven distance
double m_distance_current;
double m_distance_last;
double m_distance_delta;

// calculated data - acceleration
double m_acceleration_current;
double m_acceleration_last;
double m_acceleration_min;
double m_acceleration_max;
std::deque<double> m_acceleration_mintime;
std::deque<double> m_acceleration_maxtime;
std::deque<double> m_acceleration_smooth;
double m_acceleration_delta;

// calculated data - turn (0..1)
double m_turn_current;
double m_turn_last;
double m_turn_delta;

// calculated data - angle derived from turn and MAX_STEERING_ANGLE
double m_angle_current;
double m_angle_last;
double m_angle_delta;
std::deque<double> m_angle_smooth;

// helper
std::string getLogPath();
std::string getTimeString();

// log writing
void writeLogFile(std::string delimiter, std::string filename);
void publishHud();

public:
LogStats();

private:
void controlledDriveParametersCallback(const drive_msgs::drive_param::ConstPtr& drive_parameters);
void maxSpeedCallback(const std_msgs::Float64::ConstPtr& max_speed);
// void gazeboStateTelemetryCallback(const drive_msgs::gazebo_state_telemetry::ConstPtr& gazebo_state_telemetry);
};
24 changes: 24 additions & 0 deletions ros_ws/src/analysis-tools/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>
<package format="2">
<name>analysis-tools</name>
<version>0.0.0</version>
<description>Tools for analysing the driving behaviour.</description>

<!-- Maintainer -->
<maintainer email="[email protected]">PG F1/10</maintainer>

<!-- License -->
<license>MIT</license>
<license>GPLv3</license>

<!-- Dependencies -->
<buildtool_depend>catkin</buildtool_depend>

<depend>roscpp</depend>
<depend>std_msgs</depend>
<depend>car_config</depend>
<depend>vesc_sim</depend>
<depend>drive_msgs</depend>
<depend>geometric_math</depend>

</package>
Loading