# The "/objective" topic;

**URL:** <https://get-help.theconstruct.ai/t/the-objective-topic/22014>\
**Category:** ROS Perception in 5 Days\
**Tags:** error\
**Created:** [January 30, 2023, 1:05pm UTC](https://get-help.theconstruct.ai/t/the-objective-topic/22014 "2023-01-30T13:05:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![eyanagazi](https://get-help.theconstruct.ai/letter_avatar_proxy/v4/letter/e/ee7513/32.png) [@eyanagazi](https://get-help.theconstruct.ai/u/eyanagazi)\
**Post date:** [January 30, 2023, 1:05pm UTC](https://get-help.theconstruct.ai/t/the-objective-topic/22014/1 "2023-01-30T13:05:17Z")

</div>

Hey all,  
I’m working on PhantomX Hexapod Perception Project and I’m getting trouble with the “Follow\_Line” part.  
My problem is that nothing is published in “/objective” topic. I got the following error. I got the same error when I run the solution code

 ![objective_topic_error](https://get-help.robotigniteacademy.com/uploads/default/original/2X/f/f21535bb0d10c31ada544bec62e39a1d4992654f.png)

---

<div class="post-metadata">

**Author:** ![duckfrost2](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/duckfrost2/32/9365_2.png) [@duckfrost2](https://get-help.theconstruct.ai/u/duckfrost2)\
**Post date:** [February 1, 2023, 10:48am UTC](https://get-help.theconstruct.ai/t/the-objective-topic/22014/2 "2023-02-01T10:48:37Z")

</div>

Hi

Sorry for the late replay.

The objective topic has to be published by **YOU**. It states whihc colour of line to be followed, in this case **green**.

To publish it just execute this command in any other shell:

> rostopic pub /objective std\_msgs/String “data: ‘green’”

Take into account that the first time it launches and takes that topic you might get this error: \>

> Exception==list index out of range-yellow
> 
> (crop\_img:1388): Gdk-ERROR \*_: 10:37:33.145: The program ‘crop\_img’ received an X Window System error.  
> This probably reflects a bug in the program.  
> The error was ‘BadAccess (attempt to access private resource denied)’.  
> (Details: serial 484 error\_code 10 request\_code 130 (MIT-SHM) minor\_code 1)  
> (Note to programmers: normally, X errors are reported asynchronously;  
> that is, you will receive the error a while after causing it.  
> To debug your program, run it with the GDK\_SYNCHRONIZE environment  
> variable to change this behavior. You can then get a meaningful  
> backtrace from your debugger if you break on the gdk\_x\_error() function.)  
> [my\_hexapod\_line\_objective-1] process has died [pid 1388, exit code -5, cmd /home/user/catkin\_ws/src/perception\_course\_solutions/hexapod\_project\_solutions/my\_hexapod\_perception/scripts/line\_objective.py \_\_name:=my\_hexapod\_line\_objective \_\_log:=/home/user/.ros/log/15272942-a21c-11ed-a516-0242ac140006/my\_hexapod\_line\_objective-1.log].  
> log file: /home/user/.ros/log/15272942-a21c-11ed-a516-0242ac140006/my\_hexapod\_line\_objective-1_.log  
> all processes on machine have died, roslaunch will exit  
> shutting down processing monitor…  
> … shutting down processing monitor complete  
> done

Its juts related to the Ubuntu system when its start s the session of the day. If you relaunch the sim and relaunch everything it should work, appearing all the images of line processing and the hexapod moving around.

 ![Screenshot from 2023-02-01 11-48-06](https://get-help.robotigniteacademy.com/uploads/default/original/2X/4/433be15203b71113f83b5935045ddcc3bb026cd0.jpeg)

Hope this helped and again sorry for the late response
