Skip to content

Conversation

stevendes
Copy link
Owner

@stevendes stevendes commented Oct 24, 2019

robot_sensor

UPDATE 1

  • Attached the previously created Color Sensor plugin to the Create model

HOW IT WORKS

It responds by sending an Bool message to the topic related to the specified camera, for example, the left sensor publishes in the topic "left_yellow_sensor".

ISSUES

  • Only works when a there is a subscription in the "image_raw" topic of every camera.

UPDATE 2

  • Addressed all issues and comments, working fine.

@stevendes
Copy link
Owner Author

@eborghi10
Copy link

Some things @stevendes:

  1. Was the issue with alwaysOn fixed?
  2. try2 is your target branch? Consider using better names.
  3. You have conflicts.

@stevendes
Copy link
Owner Author

stevendes commented Oct 28, 2019

Some things @stevendes:

1. Was the issue with `alwaysOn` fixed?

2. `try2` is your target branch? Consider using better names.

3. You have conflicts.

Hello @eborghi10

1- The issue wasn't fixed yet, all the things that I tried didn't work out
2- Yes haha, you already pointed me that out when I used that branch for the PR, but because this is that same branch, has the same name since I didn't closed that PR and opened a new one, and I used better name to my branches since then
3- I would check it and then tag everyone again

if ((*this->image_connect_count_) > 0)
{
common::Time cur_time = this->world_->SimTime();
if (cur_time - this->last_update_time_ >= this->update_period_)

Choose a reason for hiding this comment

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

This variable (last_update_time_) is never set before. You need to do it in Load().

Copy link
Owner Author

Choose a reason for hiding this comment

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

Putting this->last_update_time_ = this->world_->SimTime(); in the CameraPlugin::Load breaks Gazebo

common::Time cur_time = this->world_->SimTime();
if (cur_time - this->last_update_time_ >= this->update_period_)
{
this->PutCameraData(_image);

Choose a reason for hiding this comment

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

Is this necessary?

Copy link
Owner Author

Choose a reason for hiding this comment

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

Gazebo misbehave without it

@eborghi10
Copy link

  1. Was the issue with alwaysOn fixed?

1- The issue wasn't fixed yet, all the things that I tried didn't work out

@serraramiro1 (Tag Lucas too because I can't), could you check if you find out what's going on?

@serraramiro1
Copy link

  1. Was the issue with alwaysOn fixed?

1- The issue wasn't fixed yet, all the things that I tried didn't work out

@serraramiro1 (Tag Lucas too because I can't), could you check if you find out what's going on?

The way i fixed this, was adding this line to the load function.

  this->parentSensor_->SetActive(true);

Didn't find any documentation for that though

Copy link

@ernestmc ernestmc left a comment

Choose a reason for hiding this comment

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

Left some comments

@eborghi10
Copy link

eborghi10 commented Oct 30, 2019

I have an error when I try to compile your branch:

In file included from /opt/ros/kinetic/include/ros/serialization.h:37:0,
                 from /opt/ros/kinetic/include/ros/publisher.h:34,
                 from /opt/ros/kinetic/include/ros/node_handle.h:32,
                 from /opt/ros/kinetic/include/ros/ros.h:45,
                 from /create_ws/src/create_autonomy/ca_gazebo/src/color_sensor_plugin.cpp:2:
/opt/ros/kinetic/include/ros/message_traits.h: In instantiation of ‘static const char* ros::message_traits::MD5Sum<M>::value(const M&) [with M = bool]’:
/opt/ros/kinetic/include/ros/message_traits.h:255:102:   required from ‘const char* ros::message_traits::md5sum(const M&) [with M = bool]’
/opt/ros/kinetic/include/ros/publisher.h:112:7:   required from ‘void ros::Publisher::publish(const M&) const [with M = bool]’
/create_ws/src/create_autonomy/ca_gazebo/src/color_sensor_plugin.cpp:123:41:   required from here
/opt/ros/kinetic/include/ros/message_traits.h:126:34: error: request for member ‘__getMD5Sum’ in ‘m’, which is of non-class type ‘const bool’
     return m.__getMD5Sum().c_str();
                                  ^
/opt/ros/kinetic/include/ros/message_traits.h: In instantiation of ‘static const char* ros::message_traits::DataType<M>::value(const M&) [with M = bool]’:
/opt/ros/kinetic/include/ros/message_traits.h:264:104:   required from ‘const char* ros::message_traits::datatype(const M&) [with M = bool]’
/opt/ros/kinetic/include/ros/publisher.h:112:7:   required from ‘void ros::Publisher::publish(const M&) const [with M = bool]’
/create_ws/src/create_autonomy/ca_gazebo/src/color_sensor_plugin.cpp:123:41:   required from here
/opt/ros/kinetic/include/ros/message_traits.h:143:36: error: request for member ‘__getDataType’ in ‘m’, which is of non-class type ‘const bool’
     return m.__getDataType().c_str();
                                    ^
create_autonomy/ca_gazebo/CMakeFiles/color_sensor_plugin.dir/build.make:62: recipe for target 'create_autonomy/ca_gazebo/CMakeFiles/color_sensor_plugin.dir/src/color_sensor_plugin.cpp.o' failed
make[2]: *** [create_autonomy/ca_gazebo/CMakeFiles/color_sensor_plugin.dir/src/color_sensor_plugin.cpp.o] Error 1
CMakeFiles/Makefile2:5478: recipe for target 'create_autonomy/ca_gazebo/CMakeFiles/color_sensor_plugin.dir/all' failed
make[1]: *** [create_autonomy/ca_gazebo/CMakeFiles/color_sensor_plugin.dir/all] Error 2
Makefile:138: recipe for target 'all' failed
make: *** [all] Error 2
Invoking "make -j8 -l8" failed

@stevendes I found where the error is but it is up to you to solve this particular issue.
Hint: it's related to a ROS message.

@eborghi10
Copy link

Some things to improve here:

  • You didn't address most of my comments.
  • You have to improve a lot the tabulations and empty lines.

@eborghi10
Copy link

If I run this: roslaunch ca_gazebo create_autorace.launch, the simulation breaks:

XML parsing error: not well-formed (invalid token): line 101, column 1
when instantiating macro: create_base (/create_ws/src/create_autonomy/ca_description/urdf/create_base.xacro)in file: /create_ws/src/create_autonomy/ca_description/urdf/color_sensor.xacroincluded from: /create_ws/src/create_autonomy/ca_description/urdf/create_2.xacroCheck that: - Your XML is well-formed - You have the xacro xmlns declaration: xmlns:xacro="http://www.ros.org/wiki/xacro"while processing /create_ws/src/create_autonomy/ca_gazebo/launch/create_empty_world.launch:while processing /create_ws/src/create_autonomy/ca_gazebo/launch/spawn_multirobot.launch:while processing /create_ws/src/create_autonomy/ca_gazebo/launch/spawn_create.launch:while processing /create_ws/src/create_autonomy/ca_description/launch/create_description.launch:Invalid <param> tag: Cannot load command parameter [robot_description]: command [/opt/ros/kinetic/lib/xacro/xacro --inorder /create_ws/src/create_autonomy/ca_description/urdf/create_2.xacro visualize:=false] returned with code [2]. 

Param xml is <param command="$(find xacro)/xacro --inorder $(arg model) $(arg xacro_args)" name="robot_description"/>
The traceback for the exception was written to the log file

@stevendes
Copy link
Owner Author

@eborghi10 I still didn't push the file with the addressed commits, the ones that are open hasn't been addressed yet, I don't have errors locally so maybe they are because the last commit is only to resolve the conflicts that were present, I would push it now and please let me know if the error is still present.

@eborghi10
Copy link

I wasn't able to test your code. What should I do? Which topics should I look at?

@eborghi10
Copy link

You have conflicts with the base branch.

@stevendes stevendes force-pushed the color_plugin branch 5 times, most recently from f893557 to 4cb1817 Compare October 31, 2019 14:59
@stevendes
Copy link
Owner Author

@eborghi10 addressed most of the comments, the issue with the activation is still present but I'm moving forward with the actionlib task, then I would return to this and try to solve it again

Copy link

@LucasJSch LucasJSch left a comment

Choose a reason for hiding this comment

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

Left some comments, PTAL.

@stevendes stevendes force-pushed the color_plugin branch 2 times, most recently from e99b4a9 to 6685a66 Compare November 7, 2019 13:27
Copy link

@eborghi10 eborghi10 left a comment

Choose a reason for hiding this comment

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

I made some comments, PTAL.

Applied changes requested

Adressed the issues commented

Fixed type

Update sensor model

Added camera mesh

Add color sensor

Applied changes requested

Adressed the issues commented

Fixed type

Add color sensor

Applied changes requested

Adressed the issues commented

Fixed type

Add color sensor

Applied changes requested

Adressed the issues commented

Fixed type

Add color sensor

Applied changes requested

Adressed the issues commented

Fixed type

changed xacro files

Modifying the original plugin to detect RGB

Added the plugin in the two color sensors from previous PR

Adding the files for the sensor plugin

Add action messages

Addressed some comments and added realistic mesh

Addressed requested changes, added comments

Fixed publication in sensor plugin

Update camera plugin

Addressed all the comments
@stevendes
Copy link
Owner Author

Addressed all the comments

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.

5 participants