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

[WIP] Use grouped low level components for simulation #583

Merged

Conversation

fmessmer
Copy link
Member

@fmessmer fmessmer commented Jan 11, 2017

builds on top of #575
I then introduced a sim launch-argument and made use of it in cob_bringup/robot.xml

There I followed the scheme:
Within each machine-tag:

  • first there is a hardware-specific group unless="$(arg sim)", where hardware specific nodes are started
  • followed by a block of "togglable" component launch files where the sim argument is passed
  • ending in a block of nodes that can be used identically within hardware and simulation

Afterwards I removed from cob_configuration_controller_gazebo/default_controllers_robot.launch all the parts that are now covered by the new robot.xml file. What is left there is simulation-specific.

To use this in simulation ipa320/cob_simulation#131 is required

This is part of #437

@fmessmer fmessmer changed the title Use grouped low level components for simulation [WIP] Use grouped low level components for simulation Jan 11, 2017
@fmessmer
Copy link
Member Author

grouping legacy components and applying new structure for cob3-2

@fmessmer
Copy link
Member Author

@ipa-mdl @ipa-fmw @ipa-nhg @ipa-bnm @ipa-mig feedback welcome!

@fmessmer fmessmer force-pushed the grouped-low-level-components_simulation branch from 1c07fcf to 44319a0 Compare January 12, 2017 14:55
@fmessmer
Copy link
Member Author

Still missing are the raw's
I also will compare rosnode list, rostopic list, rosservice list and rosparam list of simulation (indigo_dev vs. feature_branch) as well as simulation vs. hardware (where possible) in order to see whether I missed something.

Still, feel free to drop in feedback already!

Copy link
Member

@mgruhler mgruhler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getting impatient? ;-)

I like this. Seems to reduce a lot of duplication.

(Note that I did not check all robot specific launch and xml files for now)

<arg name="raw_cmd_vel_topic" default="velocity_smoother/command"/>
<arg name="smooth_cmd_vel_topic" default="twist_controller/command"/>
<arg name="robot_cmd_vel_topic" default="twist_controller/command"/>
<arg name="odom_topic" default="odometry_controller/odometry"/>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mixed tabs and spaces

<arg name="name" default="head_cam"/>
<arg name="sim" default="false"/>

<include unless="$(arg sim)" file="$(find cob_bringup)/drivers/usb_camera_node.launch">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tabs vs spaces

<arg name="camera_name" value="$(arg name)"/>
<arg name="colorimage_in" value="/$(arg name)/image_rect_color"/>
<arg name="colorimage_out" value="/$(arg name)_upright/image_rect_color"/>
</include>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2 tabs

<include file="$(find cob_bringup)/controllers/cob_trajectory_controller.launch">
<arg name="robot" value="$(arg robot)"/>
<arg name="component_name" value="$(arg component_name)"/>
</include>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tabs vs spaces

<arg name="robot" value="$(arg robot)" />
<arg name="component_name" value="$(arg component_name)" />
</include>
<include file="$(find cob_bringup)/controllers/cob_trajectory_controller.launch">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imo, it would improve readability to add an empty line between includes. what do you think?

</group>
<include file="$(find cob_bringup)/components/canopen_base.launch" unless="$(arg use_old_base_drive_chain)">
<arg name="robot" value="$(arg robot)"/>
</include>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

shouldn't the group block below be exchanged with the legacy_base.launch file`?

</include>
<!--include file="$(find cob_bringup)/tools/wifi_monitor.launch" >
<arg name="robot" value="$(arg robot)" />
</include-->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a reason to comment out the wifi_monitor?

@mathias-luedtke
Copy link
Contributor

mathias-luedtke commented Jan 13, 2017

I also will compare rosnode list, rostopic list, rosservice list and rosparam list of simulation (indigo_dev vs. feature_branch) as well as simulation vs. hardware (where possible) in order to see whether I missed something.

Please try roslaunch-dump it should dump the fully parsed launchfile with all entries sorted for comparison.

@fmessmer
Copy link
Member Author

@ipa-mdl, I tried to figure out how to use your script...can you give a usage example?

@mathias-luedtke
Copy link
Contributor

mathias-luedtke commented Jan 13, 2017

I tried to figure out how to use your script...can you give a usage example?

as you would run roslaunch..
./roslaunch-dump cob_bringup cob4-2.launch
(chmod +x roslaunch-dump first)

@mathias-luedtke
Copy link
Contributor

mathias-luedtke commented Jan 13, 2017

The script does not handle $() expressions for now, will fix it.
Script works fine, had a faulty package in my catkin workspace..

@fmessmer fmessmer force-pushed the grouped-low-level-components_simulation branch 3 times, most recently from 68e3400 to 4281c06 Compare January 13, 2017 15:41
@fmessmer
Copy link
Member Author

fmessmer commented Jan 13, 2017

For travis to be happy, https://github.com/ipa320/cob_common/pull/202 is required

I consider this restructuring done....for now...more iterations will follow...(see suggested steps below)
I guaranteed the exact same behavior of the hardware (to the best of my knowledge and belief) using @ipa-mdl's roslaunch-dump doing a meld-comparison between the result of
roslaunch-dump cob_bringup robot.launch robot:=cobX-X
for the ipa320/indigo_dev and this feature branch

Simulation is working for all robots and basic functionality tests (move around using dashboard) were successful

In case you guys agree with this approach, I would like to merge this quite soon, as it will almost be impossible to resolve merge conflicts in case other PRs get merged in the meantime...

@fmessmer fmessmer changed the title [WIP] Use grouped low level components for simulation Use grouped low level components for simulation Jan 13, 2017
@fmessmer fmessmer force-pushed the grouped-low-level-components_simulation branch from e0cf511 to 5cfdc20 Compare January 13, 2017 20:36
@fmessmer
Copy link
Member Author

fmessmer commented Jan 13, 2017

In future PRs

  • sort nodes/includes (alphabetically?) so that inter-robot comparison is easier
  • harmonize robots, i.e. converge xml's again
  • verify/harmonize simulation vs. hardware
  • further group frequently used stuff, e.g. teleop, script_server,....into a command_tools.launch
  • move cob_controller_configuration_gazebo package to cob_simulation, then introduce "cob_bringup"-like structure within cob_bringup_sim, finally getting rid of cob_controller_configuartion_gazebo package by moving launch files and scripts to appropriate location

...among other things...tbd


<include file="$(find cob_bringup)/drivers/usb_camera_node.launch">
<include unless="$(arg sim)" file="$(find cob_bringup)/drivers/usb_camera_node.launch">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

alignment was wrong

@@ -8,6 +8,7 @@

<include unless="$(arg sim)" file="$(find realsense_camera)/launch/r200_nodelet_rgbd.launch">
<arg name="camera" value="$(arg name)"/>
<arg name="num_worker_threads" default="$(arg num_worker_threads)" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

default -> value?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

copy-paste...:wink:

Copy link
Contributor

@mathias-luedtke mathias-luedtke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the woes of commit-based review ;)

@fmessmer fmessmer force-pushed the grouped-low-level-components_simulation branch from 5cfdc20 to 0a5f1d0 Compare January 13, 2017 22:58
<arg name="robot" value="$(arg robot)"/>
<arg name="yaml_name" value="$(arg name)"/>
</include>
<include file="$(find cob_bringup)/drivers/image_flip_nodelet.launch">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use flip argument

<arg name="robot" value="$(arg robot)"/>
<arg name="yaml_name" value="$(arg name)"/>
</include>
<include file="$(find cob_bringup)/drivers/image_flip.launch">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use flip argument

@fmessmer
Copy link
Member Author

Will be rebased and squash-merged after #585 and updated #579 (by @ipa-mdl)

@fmessmer fmessmer changed the title Use grouped low level components for simulation [WIP] Use grouped low level components for simulation Jan 17, 2017
@fmessmer fmessmer force-pushed the grouped-low-level-components_simulation branch from 4bcb15d to cd4b234 Compare January 18, 2017 09:57
@fmessmer
Copy link
Member Author

I rebased this feature branch on top of indigo_dev as #579 and #585 have been merged now.
@ipa-fmw @ipa-nhg @ipa-mdl please one final review...
...and then this PR should be Squash and merge into a single commit e.g. "group components and restructure"

@floweisshardt floweisshardt merged commit ad46472 into ipa320:indigo_dev Jan 18, 2017
@fmessmer
Copy link
Member Author

tag eol-cob3 has been added

@fmessmer fmessmer deleted the grouped-low-level-components_simulation branch January 18, 2017 13:13
@fmessmer fmessmer restored the grouped-low-level-components_simulation branch January 18, 2017 13:14
ipa-nhg pushed a commit to ipa-nhg/cob_robots that referenced this pull request Jan 18, 2017
* refactored generic canopen&config into canopen_generic.launch

* refactored base driver+config into canopen_base.launch

* added components/cob4_head_camera.launch

* added components/cam3d_openni2.launch

* added components/cam3d_r200_rgbd.launch

* introduce sim arg for components

* use sim arg in robot.xml

* remove nodes started within robot.xml from default_controllers_robot.launch

* introducing legacy components

* reorganize and sim toggle for more components

* adjust cob4-1 to latest changes

* use new structure for cob3-2

* use new structure for cob3-6

* use new structure for cob3-9

* use new structure for cob4-2

* use new structure for remaining cob4s

* travis fixes

* syntax styling

* use new structure for raws

* more travis fixes

* harmonize old vs. new behavior cob4-1

* guarantee same hw behavior as before

* add flip argument
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants