@@ -378,6 +378,64 @@ convert_gz_to_ros(
378
378
ros_msg.intensity = gz_msg.intensity ();
379
379
}
380
380
381
+ template <>
382
+ void
383
+ convert_ros_to_gz (
384
+ const ros_gz_interfaces::msg::MaterialColor & ros_msg,
385
+ gz::msgs::MaterialColor & gz_msg)
386
+ {
387
+ using EntityMatch = gz::msgs::MaterialColor::EntityMatch;
388
+
389
+ switch (ros_msg.entity_match ) {
390
+ case ros_gz_interfaces::msg::MaterialColor::FIRST:
391
+ gz_msg.set_entity_match (EntityMatch::MaterialColor_EntityMatch_FIRST);
392
+ break ;
393
+ case ros_gz_interfaces::msg::MaterialColor::ALL:
394
+ gz_msg.set_entity_match (EntityMatch::MaterialColor_EntityMatch_ALL);
395
+ break ;
396
+ default :
397
+ std::cerr << " Unsupported entity match type ["
398
+ << ros_msg.entity_match << " ]\n " ;
399
+ }
400
+
401
+ convert_ros_to_gz (ros_msg.header , (*gz_msg.mutable_header ()));
402
+ convert_ros_to_gz (ros_msg.entity , *gz_msg.mutable_entity ());
403
+ convert_ros_to_gz (ros_msg.ambient , *gz_msg.mutable_ambient ());
404
+ convert_ros_to_gz (ros_msg.diffuse , *gz_msg.mutable_diffuse ());
405
+ convert_ros_to_gz (ros_msg.specular , *gz_msg.mutable_specular ());
406
+ convert_ros_to_gz (ros_msg.emissive , *gz_msg.mutable_emissive ());
407
+
408
+ gz_msg.set_shininess (ros_msg.shininess );
409
+ }
410
+
411
+ template <>
412
+ void
413
+ convert_gz_to_ros (
414
+ const gz::msgs::MaterialColor & gz_msg,
415
+ ros_gz_interfaces::msg::MaterialColor & ros_msg)
416
+ {
417
+ using EntityMatch = gz::msgs::MaterialColor::EntityMatch;
418
+ if (gz_msg.entity_match () == EntityMatch::MaterialColor_EntityMatch_FIRST) {
419
+ ros_msg.entity_match = ros_gz_interfaces::msg::MaterialColor::FIRST;
420
+ /* *INDENT-OFF* */
421
+ } else if (gz_msg.entity_match () ==
422
+ EntityMatch::MaterialColor_EntityMatch_ALL) {
423
+ /* *INDENT-ON* */
424
+ ros_msg.entity_match = ros_gz_interfaces::msg::MaterialColor::ALL;
425
+ } else {
426
+ std::cerr << " Unsupported EntityMatch [" <<
427
+ gz_msg.entity_match () << " ]" << std::endl;
428
+ }
429
+ convert_gz_to_ros (gz_msg.header (), ros_msg.header );
430
+ convert_gz_to_ros (gz_msg.entity (), ros_msg.entity );
431
+ convert_gz_to_ros (gz_msg.ambient (), ros_msg.ambient );
432
+ convert_gz_to_ros (gz_msg.diffuse (), ros_msg.diffuse );
433
+ convert_gz_to_ros (gz_msg.specular (), ros_msg.specular );
434
+ convert_gz_to_ros (gz_msg.emissive (), ros_msg.emissive );
435
+
436
+ ros_msg.shininess = gz_msg.shininess ();
437
+ }
438
+
381
439
template <>
382
440
void
383
441
convert_ros_to_gz (
0 commit comments