-
Notifications
You must be signed in to change notification settings - Fork 1
/
Cmd.txt
86 lines (65 loc) · 5.02 KB
/
Cmd.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#This is a template file for terminal commands (i.e. a guideline to reproduce results)
#Change default name of maserati4pgts to your DUCKIEBOT_NAME
## General info:
Vars:
goal_input: [AT id of type int32, distance in cm from 2nd last AT of type int32]
Define as a list or array in .launch file with param type "array"
Follow this definition protocol: http://wiki.ros.org/rospy/Overview/Parameter%20Server and https://docs.python.org/2/library/xmlrpclib.html
Also: https://www.clearpathrobotics.com/assets/guides/ros/ROS%20Parameter%20Server.html and https://answers.ros.org/question/206146/arrays-ros-launch-file/
starting_point: AT id of type int32 from msg type AprilTagsWithInfos
Derived from the incoming msg of type AprilTagsWithInfos from the subscribed topic apriltags_prostprocessing
## Terminal commands:
Preparation:
$ ping maserati4pgts.local
# Update the main images required for implementation
$ docker -H maserati4pgts.local pull duckietown/dt-car-interface:daffy
$ docker -H maserati4pgts.local pull duckietown/dt-duckiebot-interface:daffy
$ docker -H maserati4pgts.local pull duckietown/dt-core:daffy
Build ind_nav demo without random_april_tag_turns_node:
# Make sure all old containers from the images dt-core, dt-duckiebot-interface, dt-car-interface are stopped (using portainer)
# Access portainer using "maserati4pgts.local:9000/#/containers"
$ dts duckiebot demo --demo_name all_drivers --duckiebot_name maserati4pgts --package_name duckiebot_interface --image duckietown/dt-duckiebot-interface:daffy
$ dts duckiebot demo --demo_name all --duckiebot_name maserati4pgts --package_name car_interface --image duckietown/dt-car-interface:daffy
# Do NOT use default cmd for indefinite_navigation: dts duckiebot demo --demo_name indefinite_navigation --duckiebot_name maserati4pgts --package_name duckietown_demos --image duckietown/dt-core:daffy
$ docker -H maserati4pgts.local run -it --name dt-core-goto1 -v /data:/data --privileged --rm --net host duckietown/dt-core:daffy /bin/bash
Within /bin/bash install vim (texteditor) and exclude random_april_tag_turns_node through:
$ apt-get update
$ apt-get install vim
$ ls
# go to the .launch files directory /code/catkin_ws/src/dt-core/packages/duckietown_demos/launch using the cd /path cmd
$ vim indefinite_navigation.launch
# edit the file by putting value of apriltags_random to "false" by pressing "i" to insert/change the file once opened
# use ":q!" and enter to exit without saving, and ":w" or ":wq" for saving the file: see also https://linuxize.com/post/how-to-save-file-in-vim-quit-editor/
# then (inside the root) type the edited version of the launch.sh file:
$ roslaunch duckietown_demos indefinite_navigation.launch veh:="maserati4pgts"
# WARNING: the edited indefinite_navigation is now running, leave this running at all times
# you will see an overview of all parameters, but wait about 5 minutes until everything is running (see also portainer log)
Run test module (subset of goto-1 solution) in another terminal window:
$ dts devel watchtower stop -H maserati4pgts.local
$ chmod +x ./packages/my_package/src/global_localization.py
$ chmod +x ./packages/my_package/src/state_estimation.py
$ dts devel build -f --arch arm32v7 -H maserati4pgts.local
# Change ROS_MASTER_URI to personal DUCKIEBOT_IP (found during ping cmd), replace IMAGE_NAME:IMAGE_TAG with retrieved image name
$ docker -H maserati4pgts.local run -it --name proj-goto-1 --privileged -v /data:/data -e ROS_MASTER_URI=http://DUCKIEBOT_IP=192.168.1.116:11311/ --rm --net host duckietown/IMAGE_NAME:IMAGE_TAG /bin/bash
Within /bin/bash run the following (if not, default value will be used as defined in localization_node_test.launch):
$ roslaunch my_package proj_goto_1.launch goal_input:="199" goal_distance:="40" new_v_bar:="0.15"
# or
$ roslaunch my_package proj_goto_1.launch goal_input:="11" goal_distance:="60" new_v_bar:="0.12"
# if desired, add the following to the above command in order to tune the intersection navigation (default values lister here and in .launch file)
# se_switch:="True" inter_nav_ff_left:="0.4" inter_nav_ff_right:="-0.6" inter_nav_time_left_turn:="3.2" inter_nav_time_right_turn:="1.5"
# ignore: robot_name:="maserati4pgts"
To see rqt graph (check if all connections are made):
$ dts start_gui_tools maserati4pgts
$ rostopic list
$ rqt_graph
$ rqt_image_view
Start indefinite_navigation via joystick keyboard_control
$ dts duckiebot keyboard_control maserati4pgts
# or
$ dts duckiebot keyboard_control maserati4pgts --base_image duckietown/dt-core:daffy-amd64
Run the following container to adjust the params for lane_controlling during run_time from /bin/bash:
$ docker run -it --rm -e ROS_MASTER_URI="http://DUCKIEBOT_IP=192.168.1.116:11311/" duckietown/dt-ros-commons:daffy-amd64 /bin/bash
# inside the root, do
$ rosparam list
$ rosparam get /directory/path/file
$ rosparam set /directory/path/file 0.6